Forum Sitebox issues because of Facebook API updates?

Discussion and help relating to the PlayerIO webpage and Facebook app hosting solution, Sitebox.

issues because of Facebook API updates?

Postby Zinder » January 3rd, 2012, 12:53 am

Chrome JS Console outputs an error:

Code: Select all
Uncaught TypeError: Cannot call method 'authResponseChange' of null
FBAS.updateSwfAuthResponse
(anonymous function)
(anonymous function)all.js:11
FB.provide.forEachall.js:4
FB.provide.fireall.js:11
FB.provide.setAuthResponseall.js:23
(anonymous function)all.js:23
FB.provide._xdRecvall.js:22
(anonymous function)all.js:22
FB.provide.recvall.js:12
FB.provide.PostMessage.onMessage


And after buying coins with PayVault (after clicking "OK" on Facebook success popup) another error shows up:

Code: Select all
Uncaught TypeError: Cannot call method 'uiResponse' of null
cb
(anonymous function)all.js:38
FB.provide.recvall.js:12
FB.provide.PostMessage.onMessage


Facebook made some changes to their API so maybe i think that is what is causing the error

Here are some solutions: http://code.google.com/p/facebook-actionscript-api/issues/detail?id=395#c9

Is Sitebox up-to-date? (e.g. 'perms' parameter now should be 'scope')
Zinder
 
Posts: 10
Joined: June 6th, 2011, 5:28 pm

Re: issues because of Facebook API updates?

Postby Oliver » January 3rd, 2012, 11:07 am

Hello Zinder,

- Are you using the official ActionScript Facebook API (http://code.google.com/p/facebook-actionscript-api)?
- Did you do anything yourself to get the error (ie, update the api?)
- What is the url for your facebook app?

Best,
Oliver
User avatar
Oliver
.IO
 
Posts: 1159
Joined: January 12th, 2010, 8:29 am

Re: issues because of Facebook API updates?

Postby Zinder » January 3rd, 2012, 2:42 pm

Thanks for the fast reply!

- yep, it looks like it is 1 year more up-to-date that the one from Playerio :)
- i haven't made any changes to the api. I'm using AJAX + jQuery but i don't see any conflict with it
- https://apps.facebook.com/winnerswaytest/
(here is the Playerio link https://gameclub-keir6opw40azy8e8klqtia.fb.playerio.com/fb/gameclub-facebook-app/ so you can check out html + JS files)
Zinder
 
Posts: 10
Joined: June 6th, 2011, 5:28 pm

Re: issues because of Facebook API updates?

Postby Zinder » January 3rd, 2012, 7:25 pm

However api() method callbacks are working fine, but callbacks of init() and ui() methods are just not being triggered (because of those two errors)
Zinder
 
Posts: 10
Joined: June 6th, 2011, 5:28 pm

Re: issues because of Facebook API updates?

Postby Oliver » January 4th, 2012, 1:15 pm

Hello Zinder,

I spent some time debugging this issue today, and the problem is not in Player.IO or Sitebox, but rather in the way you're using the ActionScript 3 API. Please not that this api is not supported by us, and that we have very little experience using it (this is the first we've tried).

What i did was download their examples 2FlashWebExample" and upload one of them to a sitebox facebook app. That didn't work, and i got your exact error. The example ships with usage of 'scope' and not 'params' so that was not the cause of the error.

Using the the flash debug player and FlashTracer (https://addons.mozilla.org/da/firefox/a ... ashtracer/) i was able to determine that the problem was caused by javascript not being able to talk into flash.

I made the following changes to make it work:

I added these lines to the ActionScript file:
Code: Select all
Security.allowInsecureDomain("*");
Security.allowDomain("*")


And i made sure that the flash file was embedded with the same name and id (important) and with the proper access rights:
Code: Select all
//A 'name' attribute with the same value as the 'id' is REQUIRED for Chrome/Mozilla browsers
var args = {AllowScriptAccess:'always',AllowNetworking:'all',name:'flashContent'}
swfobject.embedSWF("{% url 'FlashWebExample.swf' %}", "flashContent", "650", "700", "9.0", null, args, args, args);    


My best guess is that if you do the same changes, you game will also work.

I've zipped and attached files used to get this app working: http://apps.facebook.com/mylittlefbapp/
FlashWebExample.zip
(633.64 KiB) Downloaded 1384 times


Let me know if this works for you.

Best,
Oliver
User avatar
Oliver
.IO
 
Posts: 1159
Joined: January 12th, 2010, 8:29 am

Re: issues because of Facebook API updates?

Postby Zinder » January 4th, 2012, 3:16 pm

So many thanks for your time, Oliver!
Both AS changes and SWF Embedding changes were required.
Now ui() callbacks are working and those errors are gone!
Zinder
 
Posts: 10
Joined: June 6th, 2011, 5:28 pm


Return to Sitebox



cron