2

I am developing an AIR application that is supposed to run on desktop and mobile platforms. For most Facebook functionality, I use the official GraphAPI for Flash, version 1.8.1.

To use the app, the user must login to Facebook, this works easily by first calling FacebookMobile.init(), and if it reports that the user is not logged in, logging in like this:

var webView :StageWebView = new StageWebView();
webView.stage = stage;
webView.viewPort = new Rectangle(0, 0, stage.stageWidth, stage.stageHeight);
FacebookMobile.login(handleLoginResult, stage, new Array(), webView);

All of this works very well, but logging out does not work as expected. Calling

FacebookMobile.logout(handleLogout);

does log out the user from Facebook, it seems, and handleLogout is always passed a true as first parameter. After this logout, when FacebookMobile.init() is called, it also correctly reports the user as not logged in. So I call the login() method from above again.

Then, the WebView opens, but closes itself immediatly, automatically logging in the user that just logged out, without showing any kind of Facebook login screen. But I want to be able to log in another user, by having to type in email and passwort.

Probably I should mention that the logging out happens when the application starts. The user can't log out himself, the application does so when starting, so that the user should be forced to login each time. Yes, this has a reason ;)

I'm sure this is some kind of caching problem, but how can I solve it with Flash/AIR?

Juicy Scripter
  • 25,778
  • 6
  • 72
  • 93
TheSHEEEP
  • 2,961
  • 2
  • 31
  • 57
  • So let me see if i get this right. When the app runs you log the person out then log them back in right away. But yet you say you don't want to do that. If so then don't log them back in. I fail to see the question you are asking. – The_asMan Jun 07 '12 at 08:29
  • I log the user out to be able to force the user to log in again. If there is another way to do that (without logging out first) I'd gladly do that. And as I stated, the logging back is NOT supposed to happen, at least not automatically without the user having to type in his information. – TheSHEEEP Jun 07 '12 at 10:55
  • When you log out set the login var to null – The_asMan Jun 07 '12 at 18:50

3 Answers3

1

Bit late but better than nothing right? I have seen this issue before when I was experimenting with the OAUTH api...

Found the potential solution while looking for a separate issue but with regards to caching/cookies...

This post explains what you need to do: http://cookbooks.adobe.com/post_Cannot_logout_from_Facebook_on_Android_devices-19254.html

Basically its not a very pretty solution, but what it does is you manually delete the folders where the caching is happening.

Hope this helps.

Bynho
  • 572
  • 6
  • 16
0

Implementing "reallyLogout" from this answer for a similar issue worked for me: https://stackoverflow.com/a/8199505/952779

Community
  • 1
  • 1
0

Clear internet explorer cache & cookies, .. and it will log you out from StageWebView facebook login

UPDATE: Change also the app id from the descriptor xml file

Deyan Vitanov
  • 695
  • 5
  • 18