kennylerma / facebook-actionscript-api

Automatically exported from code.google.com/p/facebook-actionscript-api
0 stars 0 forks source link

Facebook.ui() callback doesn't work #232

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.trying to execute Facebook.ui() with some callback function

What is the expected output? What do you see instead?
callback will never be called.

What version of the product are you using? On what operating system?
version 1.5

Please provide any additional information below.
The problem I found :

in this piece of code of FacebookJSBridge.as

//.............
ui: function( params ) 
{
    obj = FB.JSON.parse( params );
    cb = function( response ) { FBAS.getSwf().uiResponse( FB.JSON.stringify( response ), obj.method ); }
    FB.ui( obj, cb );
},
//.............

"obj.method" will be null or undefined

So I'v done somthing like that : 

//.............
method = obj.method;
cb = function( response ) { FBAS.getSwf().uiResponse( FB.JSON.stringify( 
response ), method ); }
//.............

Original issue reported on code.google.com by lkl...@gmail.com on 19 Dec 2010 at 1:07

GoogleCodeExporter commented 9 years ago
Fixed on the branch 
(http://code.google.com/p/facebook-actionscript-api/issues/detail?id=176).

Original comment by yourpalm...@gmail.com on 23 Dec 2010 at 4:04

GoogleCodeExporter commented 9 years ago
The fix by yourpalmark works fine on windows, but on Mac OS still not receiving 
the callback (tested ff/safari/chrome).

Original comment by k...@kevinkaliher.com on 11 Jan 2011 at 1:52

GoogleCodeExporter commented 9 years ago
I work on a mac... works for me on all browsers.

Original comment by yourpalm...@gmail.com on 11 Jan 2011 at 5:05

GoogleCodeExporter commented 9 years ago
Just found yourpalmark solution and works great! Thanks for that. Why they 
didn't implement this fix in the last 1.6 version?  

Original comment by mrugasie...@gmail.com on 26 Feb 2011 at 3:49

GoogleCodeExporter commented 9 years ago
If you look in the source for the latest build you'll see that around line 122 
the fix was implemented: 
http://code.google.com/p/facebook-actionscript-api/source/browse/trunk/source/ap
i/com/facebook/graph/core/FacebookJSBridge.as

Original comment by rovertn...@gmail.com on 2 Mar 2011 at 6:07

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
I'm still seeing the issue of not receiving the callback, specifically on the 
'pay' method.  It's the same issue described in the last post of this thread: 
http://forum.developers.facebook.net/viewtopic.php?pid=340129.  The JS callback 
works, but the API doesn't pass it along to the swf.  Using 1.6.1.

Original comment by kkali...@gmail.com on 30 May 2011 at 8:39

GoogleCodeExporter commented 9 years ago
kkali...@gmail.com, can you start a new issue and provide some code please? 
Thank-you.

Original comment by rovertn...@gmail.com on 10 Jun 2011 at 7:03

GoogleCodeExporter commented 9 years ago
Having the same issue as kkali..@gmail.com.
Code:
...
Facebook.ui("apprequests", dat, onUICallback, 'iframe');

function onUICallback(result:Object):void{
//dosomething here
trace("Trace");
}
...

The onUICallback was never been called if I tried it online.
it work offline(via localhost) however

Original comment by aaha...@gmail.com on 24 Jun 2011 at 3:44

GoogleCodeExporter commented 9 years ago
Another developer on the project figured it out: need to make sure when 
embedding using swfobject that attribute name exists and matches the id (in our 
case, it didn't).  A little comment on that is here:
http://code.google.com/p/facebook-actionscript-api/source/browse/trunk/source/ap
i/com/facebook/graph/core/FacebookJSBridge.as?r=335#46

Original comment by kkali...@gmail.com on 26 Jul 2011 at 9:28

GoogleCodeExporter commented 9 years ago
kkali and aaha, did you solved this issue?

Original comment by shay...@gmail.com on 28 Jul 2011 at 7:36

GoogleCodeExporter commented 9 years ago
Sort of :|
I just found out that when I hosted the swf online, I use FB.init inside the 
Index.php and pass the access_token to the swf. But it seems that I cant find a 
way to pass the redirect page('next' parameter) to the Facebook.ui parameter. I 
guess that's what causing the facebook.ui can't fire the callback.
In the offline method, I directly use facebook.init from inside the swf itself 
so all parameters needed for the facebook.ui is complete.

Original comment by aaha...@gmail.com on 29 Jul 2011 at 3:20

GoogleCodeExporter commented 9 years ago
I solved it by the code that kkali post:

http://code.google.com/p/facebook-actionscript-api/source/browse/trunk/source/ap
i/com/facebook/graph/core/FacebookJSBridge.as?r=335#46

I have another problem now, how can I view all the result and parameters that I 
get from facebook? 

there is this param: 
result.request_ids

does anyone knows what else can I call from the result?

Original comment by shay...@gmail.com on 31 Jul 2011 at 11:53

GoogleCodeExporter commented 9 years ago
Can anyone explain the following comments in file FacebookJSBridge.as?
What the (optional) attributes (name and id) in SWFObject do with the 
Facebook.ui()
in order to solve that callback function's not working?

/*
Get a reference to the embedded SWF (object/embed tag). Note that 
Chrome/Mozilla Browsers get the 'name' attribute whereas IE uses the 'id' 
attribute. This is important to note, since it relies on how you embed the SWF. 
In the examples, we embed using swfObject and we have to set the attribute 
'name' the same as the id.
*/

Original comment by ricklin...@gmail.com on 13 Aug 2011 at 4:35

GoogleCodeExporter commented 9 years ago
ricklin...@gmail.com, this blog post shows how to properly embed your swf: 
http://codeas3.tumblr.com/post/7537118603/facebook-actionscript-3-api

Original comment by rovertn...@gmail.com on 17 Aug 2011 at 8:31