bertrando / facebook-actionscript-api

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

Facebook init() returns success=null in Chrome's incognito mode #203

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Use FBJSBridge.js, flex4_fbgraph_pt3_wrapper.zip's index.html file, and call 
Facebook.init("app_id") as in 
http://www.adobe.com/devnet/facebook/articles/flex_fbgraph_pt3.html
2. Load index.html in a Chrome incognito window
3. Compare with same page loaded in regular Chrome window

What is the expected output? What do you see instead?

Expected output: init()'s callback function receives two parameters: a 
FacebookSession and null. This occurs in a regular Chrome window.
(In case of an error, the first parameter should be null, and the second 
parameter should contain information about the error.)

Actual output: init()'s callback function receives two null parameters.

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

GraphAPI_Source_1.0.zip
Chrome 7.0.517.41 beta
Windows Vista

Please provide any additional information below.

What Incognito mode is: 
http://www.google.com/support/chrome/bin/answer.py?hl=en&answer=95464

Issue seems to occur in FBJSBridge.js; the updateSwfSession() function receives 
'null' as its parameter.

Original issue reported on code.google.com by michael....@gmail.com on 3 Nov 2010 at 12:11

GoogleCodeExporter commented 9 years ago
Facebook.init("APP_ID", myFunction);

This call return nothing.
I have a trace in myFunction, but the call never arrive in this function. What 
happen!?!? I'm using Firefox and simple AS3.

Original comment by francesc...@gmail.com on 4 Nov 2010 at 9:37

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
I'm having the same issue, init's callback parameters, success and fail, are 
null. The API isn't ready after that point. This is on the FB app, I'm able to 
run the app using the AIR player and the Desktop object without a problem, but 
using the Facebook web object, no dice. This is browser independent.

Original comment by papavik...@gmail.com on 10 Nov 2010 at 5:44

GoogleCodeExporter commented 9 years ago
@papaviking: when you say "browser independent" do you mean it occurs even if 
you're not using some sort of privacy mode?

Original comment by michael....@gmail.com on 10 Nov 2010 at 5:49

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Anyone ever find a solution to this?

Original comment by mike%via...@gtempaccount.com on 26 Jan 2011 at 8:22

GoogleCodeExporter commented 9 years ago
I would suggest using the new graph API (v1.5). It doesn't use FBJSBridge.js 
and has a lot more bug fixes.

Original comment by rovertn...@gmail.com on 4 Feb 2011 at 4:04

GoogleCodeExporter commented 9 years ago
I have this in Chrome in normal mode. I've found it works ok for some users and 
not for others.
I think it might be something to do with the user having ot authorise the app, 
you know that permission prompt you get when you access an app for the first 
time. If you haven't manually made that appear for a user then Facebook.init() 
won't work. At least that's what my current thinking is. I'm still trying to 
find out how you force that prompt to appear.

Original comment by bedroom...@gmail.com on 8 Feb 2011 at 8:18

GoogleCodeExporter commented 9 years ago
You shouldn't have to force that permissions window to appear. After calling 
Facebook.init, you should get a fail object if the user isn't logged in. If the 
user isn't logged in, you should call Facebook.login. Facebook should then take 
care of the whole log in process as well as confirming permissions.

Original comment by rovertn...@gmail.com on 9 Feb 2011 at 4:34

GoogleCodeExporter commented 9 years ago
I'm getting an identical issue to the original poster: a second call to 
Facebook.init(APP_ID, onInit); will return a double null/null for both expected 
result and fail objects.

I can error-check for a double-null, but since (I assume) Facebook.init() has 
to be triggered explicitly by user interaction (i.e. clicking on a button), I 
can't call that action purely from code - I have to persuade the user to click 
the button again.

In my case, I'm loading an .swf as a child into another .swf, and the child is 
doing the Facebook connect thing. If I close and destroy the child, then 
re-open it and click to connect to Facebook, the result and fail objects both 
come through as null.

Interestingly, this actually happens if I load somefile.swf into the parent 
.swf, connect to Facebook (successfully), then close and destroy it, THEN load 
differentfile.swf into the parent and connect to Facebook - same double-null 
result. In a completely different file. Whoopee-doo.

Original comment by lawriema...@gmail.com on 16 Feb 2011 at 10:16

GoogleCodeExporter commented 9 years ago
Okay I was also banging my head on this like it's first day of school.

Here's the hack I created which works miracles.

public class FacebookConnect
    {
        public static var isConnected:Boolean = false;
        public static var connecting:Boolean = false;
        private var initDone:Function;
        private var perms:Object;
        private var tm:uint;
        private var appID:String

        public function FacebookConnect( _appID:String, _perms:Object, _initDone:Function )
        {
            perms = _perms;
            initDone = _initDone;
            appID = _appID;

            init( );
        }

        private function init( ):void
        {
            connecting = true;

            Facebook.init( appID );

            if( Facebook.getSession( ) == null)
            {
                freshLogin( );

                checkForSession( );
            }else{

                loginDone( );
            }
        }

        private function checkForSession( ):void
        {
            var fs:* = Facebook.getSession( ).uid;

            Logger.log("FacebookConnect.checkForSession.uid."+fs);

            if( null != fs)
            {
                loginDone( );
                return;
            }else{
                setTimeout( checkForSession, 1000);
            }
        }

        private function loginDone( ):void
        {
            Facebook.init( 
                appID, 
                initComplete,
                {
                    channelURL : 'http://mjdev.rtedge.ca/mpbj/channel.html'
                }
            );
        }

        private function freshLogin( ):void
        {
            Logger.log("FacebookConnect.freshLogin");

            login( );
        }

        private function login( ):void
        {
            perms['channelURL'] = 'http://mjdev.rtedge.ca/mpbj/channel.html';

            Facebook.login
            ( 
                null,
                perms
            );
        }

        private function initComplete(s:Object,f:Object):void
        {
            Logger.log("FacebookConnect._initDoneInternal."+s+":"+f);

            FacebookConnect.isConnected = s != null;

            if( s != null ) initDone( s , f );

            Logger.log( "FacebookConnect."+FacebookConnect.isConnected+":"+JSON.encode(s)+":"+JSON.encode(f) );
        }
    }

Original comment by marcin.a...@gmail.com on 28 Jun 2011 at 7:45

GoogleCodeExporter commented 9 years ago

Original comment by edwar...@gmail.com on 6 Oct 2011 at 4:25