TheSHEEEP
TheSHEEEP

Reputation: 3132

How to clear AIR cache for working Facebook logout?

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?

Upvotes: 2

Views: 2518

Answers (3)

Deyan Vitanov
Deyan Vitanov

Reputation: 784

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

Upvotes: 0

Eliad Barazi
Eliad Barazi

Reputation: 25

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

Upvotes: 0

Bynho
Bynho

Reputation: 692

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.

Upvotes: 1

Related Questions