kverweij / facebook-actionscript-api

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

FB.init problem prevents user from connecting #416

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Open your app, wait for the Facebook.init call
2. Watch for the Facebook.init result handler trigger
3.

What is the expected output? What do you see instead?
We expect the init handler function to be called. It is not. This prevents 
users to connect

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

Please provide any additional information below.
The problem happened after a Facebook API update
The fix is attached, it consists in replacing "FB.JSON" by "JSON"

Original issue reported on code.google.com by herve.la...@gmail.com on 9 May 2012 at 9:24

Attachments:

GoogleCodeExporter commented 8 years ago
Thanks a lot my friend ;-)

I'm already searching several hours for an solution.
Firebug was giving me this message when the Facebook.init() was called:

"FB.getLoginStatus() called before calling FB.init()."

And nothing to find on the net about this message in combination whit the 
Facebook as3 api. So this fixed the problem and its works fine again.

One other question: How did you find out what the problem was? I have searching 
on the Facebook developers website but i found nothing about this?

Original comment by d.v.rijs...@moonz.nl on 9 May 2012 at 10:15

GoogleCodeExporter commented 8 years ago
Works for us too!!!

Thank you so much for the solution!!

Original comment by eal...@gmail.com on 9 May 2012 at 10:16

GoogleCodeExporter commented 8 years ago
Changed it but now I have next error:
uncaught exception: Error in Actionscript. Use a try/catch block to find error.
all.js line 34

The Application it worked perfectly before this change of API

Original comment by elucubra...@gmail.com on 9 May 2012 at 10:58

GoogleCodeExporter commented 8 years ago
thanks a lot!you save my life! :)

Original comment by marcocal...@gmail.com on 9 May 2012 at 11:09

GoogleCodeExporter commented 8 years ago
@d.v.rijs:
A colleague of mine found the following stackoverflow answer which lead to the 
issue: 
http://stackoverflow.com/questions/10510907/facebook-actionscript-api-facebook-i
nit-call-is-suddenly-returning-null-sess

@elucubra: no idea, maybe Facebook changed something else?

Facebook team are also fixing something related to this issue: 
https://developers.facebook.com/bugs/420667497951980

Original comment by herve.la...@gmail.com on 9 May 2012 at 11:22

GoogleCodeExporter commented 8 years ago
Updating the FacebookJSBridge.as now i get the following js error:

swf.authResponseChange is not a function

Original comment by 7daysofr...@gmail.com on 9 May 2012 at 11:24

GoogleCodeExporter commented 8 years ago
Thanks for the report.

If I find something else you do know.

I made many changes to discover the problem. ;)

Original comment by elucubra...@gmail.com on 9 May 2012 at 11:25

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
Since it closely depends on Facebook's all.js file, and as they're currently 
working a an issue involving FB.init maybe that's something temporary...

However, the fix works for some of us... I can only guess that you missed a 
step somewhere?

Original comment by herve.la...@gmail.com on 9 May 2012 at 11:34

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
Nevermind, I had made a mistake. It works now! Thanks! :D

Original comment by christian.tellefsen@gmail.com on 9 May 2012 at 11:47

GoogleCodeExporter commented 8 years ago
solventado.

Hice cambios en la app y quité el evento fail del handler de conexión.

Gracias de nuevo. It Works now!

Original comment by elucubra...@gmail.com on 9 May 2012 at 11:56

GoogleCodeExporter commented 8 years ago
solved.

I made changes to the app and removed the event handler fail the connection. My 
fault

Thanks again.

Original comment by elucubra...@gmail.com on 9 May 2012 at 11:57

GoogleCodeExporter commented 8 years ago
I had this problem too this morning! Thanks for the solution, it works well.
Looking at the bigger picture, I think it's time to migrate to the Javascript 
SDK, this kind of bug is a deal breaker.

Original comment by phi...@2fold20play.com on 9 May 2012 at 12:02

GoogleCodeExporter commented 8 years ago
Please note that this fix is only here for getting a temporary solution, and 
works only in modern browsers (whith "JSON" support, which is not the case of 
old browsers).

The "migrate to JS" solution wouldn't have solved anything as this is initially 
a Facebook bug...

Original comment by herve.la...@gmail.com on 9 May 2012 at 12:06

GoogleCodeExporter commented 8 years ago
Login works on Safari, Firefox and Chrome, but not on Internet Explorer. I get:

SCRIPT5007: Unable to get value of the property 'authResponseChange': object is 
null or undefined 
script block (141), line 81 character 17

Relevant code block from FacebookJSBridge.as:
                                updateSwfAuthResponse: function( response ) {
...
} else {
    swf.authResponseChange( JSON.stringify( response ) ); <--- HERE                                             }
                                        }

Original comment by christian.tellefsen@gmail.com on 9 May 2012 at 12:13

GoogleCodeExporter commented 8 years ago
To be more exact, it's Internet Explorer 9.

Original comment by christian.tellefsen@gmail.com on 9 May 2012 at 12:15

GoogleCodeExporter commented 8 years ago
That's what I meant by "modern" browsers ;)

More seriously, on IE, we'll have to wait for the fix or try to replace make 
JSON work by using a custom library (http://json.org/json2.js for example).

Original comment by herve.la...@gmail.com on 9 May 2012 at 12:18

GoogleCodeExporter commented 8 years ago
Haha. :D

Now it suddenly started working again, with no changes. Maybe they fixed it at 
Facebook. Seems to be this issue:

https://developers.facebook.com/bugs/420667497951980

Original comment by christian.tellefsen@gmail.com on 9 May 2012 at 12:31

GoogleCodeExporter commented 8 years ago
Doesn't work for me right now, maybe only the US version? (I'm on the french 
one)

(BTW http://json.org/json2.js is 404, here's a backup 
https://github.com/douglascrockford/JSON-js/blob/master/json2.js)

Original comment by herve.la...@gmail.com on 9 May 2012 at 12:42

GoogleCodeExporter commented 8 years ago
No problems on IE9 so far.

@herve.la: Thanks for your reply  

Original comment by d.v.rijs...@moonz.nl on 9 May 2012 at 3:17

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
Working perfectly on Chrome,
i'll try in other browsers soon.

many thanks!

Original comment by iwester...@gmail.com on 9 May 2012 at 4:05

GoogleCodeExporter commented 8 years ago
I have the same problem, the facebook.init() doesn't work, how should I replace 
this .as File?

Original comment by felipe.m...@gmail.com on 9 May 2012 at 4:33

GoogleCodeExporter commented 8 years ago
Still broken in IE9 here.

Original comment by wavethe...@gmail.com on 9 May 2012 at 5:04

GoogleCodeExporter commented 8 years ago
Here it is, rebuilt using JSON. No need to compile it yourself.

Original comment by Chr...@gmail.com on 9 May 2012 at 6:46

Attachments:

GoogleCodeExporter commented 8 years ago
@herve.la did you end up replacing the JSON references with that json2 class in 
your implementation in order to get IE8 to work?

Original comment by wavethe...@gmail.com on 9 May 2012 at 7:11

GoogleCodeExporter commented 8 years ago
Thanks, this solve the problem, thanks!!!

Original comment by dannycor...@gmail.com on 9 May 2012 at 10:19

GoogleCodeExporter commented 8 years ago
As a matter of fact it is not Facebook problem. The FB.JSON object is not 
documented and thus it is private and not public. And everybody knows what 
happens when you rely on private interface.

As a matter of fact I don't find any reason why they should convert everything 
to JSON back and forth prior to sending it to JS/AS.

Original comment by ju...@karibugames.com on 9 May 2012 at 11:57

GoogleCodeExporter commented 8 years ago
There are no reason to encode/decode any data in the js bridge. According to 
me, they must remove FB.JSON in the FacebookActionScriptAPI. The encode/decode 
should be done only in Flash.

Original comment by perreaul...@gmail.com on 10 May 2012 at 3:10

GoogleCodeExporter commented 8 years ago
@wavethe : I didn't change for now, waiting for bosses' approval / or FB 
corrections.

However, I totally agree to ju...@karibugames.com and perreaul...@gmail.com : 
JSON.parse / JSON.stringify are available in AS3 for sure so we could change 
the way data is retrieved from the JS bridge and avoid this kind of issues once 
for all...

Original comment by herve.la...@gmail.com on 10 May 2012 at 8:50

GoogleCodeExporter commented 8 years ago
As a comment on this issue, and particularly #15 - this was not  a bug in the 
Facebook Javascript SDK, this happened due to the Flash SDK relying on an 
internal detail of the JS SDK that is not officially supported.

In not too long Facebook will removing all interfaces sans the ones listed as 
officially supported from the JS SDK, and if you have code relying on these 
(like FB.JSON) then this will break.

In this case Facebook opted to bring back these interfaces (although not used 
internally) to give the community time to adapt, so please work with the 
contributors of any third-party code you have to make sure those projects are 
aligned with this!

Original comment by oyv...@kinsey.no on 10 May 2012 at 4:10

GoogleCodeExporter commented 8 years ago
This fix doesn't work for me. Problem still persists.

Original comment by jo...@fuse.co.uk on 22 May 2012 at 12:19

GoogleCodeExporter commented 8 years ago
I tried the updated .swc to no avail. Anyone else still seeing this or have any 
ideas?

Original comment by rob.joha...@gmail.com on 25 Aug 2012 at 4:17

GoogleCodeExporter commented 8 years ago
SOLVED!! I had the same problem, Facebook.init with chrome was not callin the 
callback.. none of this solutions worked for me, instead I tryed with 
javascript, simply with this code:
<div id="fb-root"></div>
<script>
  window.fbAsyncInit = function() {
    FB.init({
      appId      : 'YOUR_APP_ID', // App ID
      status     : true, // check login status
      cookie     : true, // enable cookies to allow the server to access the session
      xfbml      : true  // parse XFBML
    });

    // Additional initialization code here
  };

  // Load the SDK Asynchronously
  (function(d){
     var js, id = 'facebook-jssdk', ref = d.getElementsByTagName('script')[0];
     if (d.getElementById(id)) {return;}
     js = d.createElement('script'); js.id = id; js.async = true;
     js.src = "//connect.facebook.net/en_US/all.js";
     ref.parentNode.insertBefore(js, ref);
   }(document));
</script>

only had to change the YOUR_APP_ID, and now works in chrome, and now as3 Graph 
api can post an image to wall.

Original comment by fmuri...@gmail.com on 1 Sep 2012 at 7:38