Method FB.ui loads forever when called on Firefox and Internet Explorer
Asked Answered
V

2

6

I have problem in a script that was working until 3 or 4 days ago.

I'm using this (simplified version) code to send an app request to a user and it was working until few days ago, now it seems that something in facebook has changed and the window (wich is opened in iframe automatically) loads forever in Firefox and Internet Explorer. It continues to work normaly.

I Know that I can force the parameter display: 'popup', but sending the request after some other javascript lines it means that firefox blocks the popup opening and so it is useless for me.

function Test()
{
FB.ui({method: 'apprequests', message: 'My Great Request' }, CallbackFunction);
}


function CallbackFunction(response)
{
alert(JSON.stringify(response));
}

The page has no style and it's clean, here the full code: http://pastebin.com/QqbRceJ2

This is what it happens: http://i59.tinypic.com/10hq6w5.png

Any help is apreciated, I'm stuck on this since monday...

Valency answered 13/3, 2014 at 19:11 Comment(1)
I have the exact same issue. Doesn't work in FF since earlier last week. Works fine in Chrome. Hangs on FB.ui for apprequests. On FF, the callback function never gets entered.Candelabra
C
2

As Slav said it's a confirmed Facebook SDK bug that's related to iframe:

It appears this issue is occurring when you provide the display:"iframe" parameter to the feed dialog. If that is removed the dialog should be displayed correctly as a temp fix while this is investigated .

Although you're not passing the display=iframe parameter, the default behavior of the FB.ui is a modal iframe:

The display parameter: determines how the dialog is rendered. If you are using the URL redirect dialog implementation, then this will be a full page display, shown within Facebook.com. This display type is called page. If you are using one of our iOS or Android SDKs to invoke the dialog, this is automatically specified and chooses an appropriate display type for the device. If you are using the JavaScript SDK, this will default to a modal iframe type for people logged into your app or async when using within a game on Facebook.com, and a popup window for everyone else. You can also force the popup or page types when using the JavaScript SDK, if necessary. Mobile web apps will always default to the touch display type.

Try changing your function Test() to this:

function Test(){
  FB.ui({display: 'popup', method: 'apprequests', message: 'My Great Request' }, CallbackFunction);
}
Comparator answered 19/3, 2014 at 10:57 Comment(1)
Interesting note about default using display=iframe. We had explicit definition, and after I removed that (with nothing in its place), the problem went away. I guess FB may have changed the default to something else for now. But why are people without explicit display parameter still affected? Maybe there is some caching going on. I suggest that people try adding explicit definition for display, running a few API calls with that, and then removing that again to "clear" whatever caching may be at play hereCandelabra
C
1

I guess the correct answer is that is is FB SDK bug as confirmed here https://developers.facebook.com/x/bugs/733458870047972/

Candelabra answered 18/3, 2014 at 20:27 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.