0
votes

I am building a Flex mobile application using Flash Builder 4.5, and testing it on a Samsung Galaxy 10.1 tab running Honeycomb.

I have integrated the AS3 Facebook library, but it won't let me log out, the session seems to stay behind, so once a user has logged in, they stay logged in until I have cleared the applications cache, or uninstalled and re-installed the application on the device.

What I would like to achieve here is to delete the cache folder for the application, or somehow clear the cache.

Any idea on how I can achieve this using AS3? Is there a better way of going about it?

Thank you.

1

1 Answers

0
votes

Add the following event listener to you main application file applicationComplete or initialize event handler:

NativeApplication.nativeApplication.addEventListener(Event.DEACTIVATE, onDeactivateApp);

In onDeactivateApp function do the following:

protected function onDeactivateApp(event:Event):void
{

    NativeApplication.nativeApplication.exit();
}

This should clear the cache, and the application will make you log back in when you restart it. This should be added to most mobile applications by the way.

Brian