daogr / facebook-actionscript-api

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

FacebookDesktop.init fails with Invalid OAuth access token #227

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.Call FacebookDesktop.init(appid,callbackFunction)
2.
3.

What is the expected output? What do you see instead?
expected: Facebook Session

instead: Invalid OAuth access token.

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

Please provide any additional information below.

I am under the impression that the optional access token that is the thrid 
parameter of init() can be left off for the initial call to init. This does not 
seem to be the case. 

Original issue reported on code.google.com by jasondi...@gmail.com on 11 Dec 2010 at 5:49

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
So, even though init has to be called first, it will return failure, and then 
you can use login. RTFE. Not sure how to make this more clear than you guys did 
with your example. Thank you.

Original comment by jasondi...@gmail.com on 11 Dec 2010 at 7:07

GoogleCodeExporter commented 9 years ago

Original comment by edwar...@gmail.com on 12 Jan 2011 at 11:03

GoogleCodeExporter commented 9 years ago
I'm also experiencing this error.  So...I can login if the third parameter is 
omitted?  This isn't in the documentation.  If it's in an email sent when the 
application is registered with the API, that isn't enough; we need explicit 
documentation in the API reference.

Original comment by mbritto...@gmail.com on 17 Jan 2011 at 5:48

GoogleCodeExporter commented 9 years ago
Before making any calls you must initialize the api by calling init(). It will 
call the callback method specified, and pass a response object or a fail object 
(see examples). If you are already logged in, the response will be an 
FacebookSession object and the fail object will be null. If you are not logged 
in, then the response will be null and the fail object will be populated with 
an error. All this means is that you are not currently logged in and you can 
call login() at this point. There may be some confusion because the error 
object states "An active access token must be used to query information about 
the current user.". This is because we attempt to make an api call to '/me' in 
order to verify if we are logged in or not during the init() method. If the 
call was successful, the user data is stored off into the FacebookSession and 
returned in the init callback. Otherwise, it returns the error. We do this 
because there this seems to be the most reliable way to checking if the user is 
currently logged in or not. The third parameter (accessToken) is completely 
optional and is available to developers who wish to manage their own access 
tokens/sessions. 

Original comment by edwar...@gmail.com on 17 Jan 2011 at 6:34

GoogleCodeExporter commented 9 years ago
Thanks for the reply.  imo the error should be changed to 'invalid oAuth access 
token.  You may continue with the login process.' 

Original comment by mbritto...@gmail.com on 17 Jan 2011 at 6:47

GoogleCodeExporter commented 9 years ago
I have a situation where the result and fail objects returned are both null.

For some users this isn't the case. I still haven't figured out the solution 
but I think it's to do with whether a user has added the app - you know, that 
permission prompt you get when you first start using an app. If you haven't 
manually forced that then Facebook.init() doesn't work.

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