FB.ui() fbml.dialog — Hangs - facebook

I'm working on a Facebook (canvas) app where I'd like to show the user a FB-style dialog box. I'm trying to do this with FB.ui(), using the fbml.dialog method. My every attempt at this today has yielded a dialog box that shows loading bars, but nothing ever happens.
Subscribing to log events shows nothing.
The code below is the simplest version I've tried, and is lifted straight from Facebook's sample code, which I've seen working (http://fbrell.com/fb.ui/fbml.dialog).
function sendToFriends(){
var dialog = {
method: 'fbml.dialog',
display: 'dialog',
fbml: '<fb:header icon="false" decoration="add_border">Hello World!</fb:header><fb:profile-pic uid="5526183"></fb:profile-pic>'
};
FB.ui(dialog, function(response){alert(response);});
}
As usual, Facebook's documentation is incomplete and all over the place. I'd appreciate any help you could offer.

The answer to your question lies probably in a buggy behaviour as documented here
FB.ui dialog for apprequest hangs forever in iframe mode
Did you try the popup mode already? Maybe this temporarily fixes the issue. Hopefully there will be a fix in the facebook api soon.

This has been answered elsewhere on stackoverflow, but I can't remember where; actually I was searching for it when I found this question.
Very approximately, you need to construct your html, put it somewhere inside the JS library for facebook (I can't remember where: possibly as a user-created element of XFBML or something), and THEN call the dialog box.
It's complicated. If I find the post I was looking for, I'll link to it here.

Related

Facebook Comments: capthca doesn't fit

I have added Facebook comments to my site as it is described in official guide:
https://developers.facebook.com/docs/plugins/comments#configurator
But when I try to post something captcha appears, and since the iframe is too short, it does not fit at height, so I see only the lowest part and don't see the top part, so I can't solve the captcha and post the comment.
If I try to increase height if the iframe with Chrome debugger then I see full captcha overlay and can solve it and then my post is added. But regular visitors of the site, of course will not debut it with debugger.
Is there a way to solve this? iframe's height is hardcoded with style attribute, so, I guess it's not solved with just css...
Well, OK. This seems to be the bug of Facebook itself.
But while they're fixing it, I've produced a temporal solution (using jQuery).
The point is to resize iframe if it's not high enough to contain the captcha box.
Unfortunately Facebook's script resizes its box itself once you click at it and there's no good ability to detect this. So I decided to perform the resize each 3 seconds. This is a nasty solution, but I hope Facebook will fix thi sbug soon, and this won't be needed anymore.
Here's my JavaScript temporal solution:
$(function(){
setInterval(function(){
if($('.fb_ltr').height() < 770) $('.fb_ltr').css({height:770}).parent().css({height: 770});
},3000);
});
Please comment if you have any improvements.

(Freshplanet Facebook-ANE) How to make the login screen in-app

I am currently using the Freshplanet Facebook-ANE and was wondering about something that is bugging me currently.
I want to implement a simple post to wall feature inside my app, and this ANE does exactly what I want, except for one thing. When I do the actual post to wall dialog, it pops up just like I want it, in a WebView inside my app. The login takes me to Safari or the Facebook app if I have it installed, which is what I want to avoid.
Here's the line I'm using to open the session :
Facebook.getInstance().openSessionWithPublishPermissions(POST_PERMISSIONS, OnSessionOpened, true);
That works perfectly for posting, but takes me outside of the app.
I've tried using the same .dialog() function I use for the post, and it worked, but I can't seem to post to the wall afterwards (maybe I'm not correctly catching the access token or something)
Any help would be appreciated. I believe I've set up everything correctly on my Facebook App page, and that my AS3 project is correctly setup.
Thanks for the help !
If you want to strictly stay into the app, you must use StageWebView. It's something like a wrapper of HTML page inside Flash.
First check if you are logged in (this is code from Facebook.as of FreshPlanet):
/** True if a Facebook session is open, false otherwise. */
public function get isSessionOpen() : Boolean
{
if (!isSupported) return false;
return _context.call('isSessionOpen');
}
If there is no session - start the web view. Otherwise - continue as usual.
You have to keep in mind that StageWebView is pretty.. how to say it.. bad is the kindest thing I could say :) You must implement your own close button, listen for url changing, etc.
You could look into Facebook AS3 SDK, which at least has some kind of 'platform' for the web view..
Good luck!

Facebook like button press does not stay liked

I'm working on a site for a client. The site is built in Joomla and is using a Facebook like button on each page. When a user clicks a like button it unclicks itself after a second or two.
I've seen several similar problems here but none have provided enough insight to help me figure out what to do to fix this problem.
I ran the page through the Facebook debugger:
https://developers.facebook.com/tools/debug/og/object?q=http%3A%2F%2Fwww.theartoflove.net%2Findex.php%2F9-blog%2Fmen%2F27-go-ahead-and-ask-her-out
but I don't have a clue how to figure out what that result is telling me. The URL I used as a test in the debugger is:
http://www.theartoflove.net/index.php/9-blog/men/27-go-ahead-and-ask-her-out
Anyone know what I need to do to fix this problem? It seems to happen regardless of what like box I put on the site (I've tried three different ones so far).
My sincere thanks for any help!
When I clicked the like button, a small 'CONFIRM' link appeared under the "Like" widget, i had to click the 'CONFIRM' link (which brought up a dialog box asking me to confirm that I liked the page) in order to get the "Like" to stick.
See image
Facebook sometimes makes the arbitrary determination that your page is 'spammy' and adds extra precautions like 'CONFIRM'. That may be part of what is going on.
The code is reentrant and the developer is flipping the bit instead of verifying the current state with a conditional before setting the value. (This is a common coding mistake. Too common.)

Facebook Comments sometimes not loading

I kindly ask you to advise why Facebook Comments sometimes do not appear on my site.
I use standard code generated from Facebook Developers site.
Please note that the Comments box is located under the colored frame. Usually, it appears after reloading the page. Real site examples:
http://wakemovies.com/?ND201206190204
http://wakemovies.com/?BL201206190157
If I recall correctly Facebook comments require a bit of customization to the dock-type they have special format.
You should add this line tou your dock type
xmlns:fb="http://www.facebook.com/2008/fbml"
One more thing you are overloading your page with Facebook like buttons. I think one is more than enough considering most people have sharing plugins installed int they browsers.
I solved this by adding a setTimeout with a delay of 1 second
example:
setTimeout(function() {
// Your Facebook Comments JavaScript Code Here
}, 1000);

Facebook Like + Send button broken?

On the facebook documentation page if you click the "Send" button in the default example, it pops open a new window that looks to be just the like/send button repeated.
I take it this is because it's broken in some way, either that or my browser (and that of my colleagues is severely broken)
Does anyone else suffer from the same fate? Does anyone have a fix?
Side note - on our website this was working fine yesterday, it appears to be a new issue.
There's a bug report about that: Send button opens new tab.
Also, looks like there are a few issues with the button as you can see in the bugs tagged with Send Button
I haven't voted you down (I rarely do), and I have no idea what were the reasons for that, but it is better to first research before asking a question here, as you can see it was easy to locate the bug(s) in the official facebook bugging report system, also if you search here you'll find more questions regarding this issue (and a few from today).
Yes, I have found that the code issued by Facebook for combination Send/Button is not working as of Sept. 27 2013. The Send button throws up a blank screen, instead of the Facebook email dialog box. This code from here https://developers.facebook.com/docs/reference/plugins/like/ did not work. Note this applies to JavaScript code, not old IFRAME code which is being deprecated.
To see a full description with images, check out link below for a solution
http://metadataconsulting.blogspot.ca/2013/09/facebook-likesend-button-not-working.html