How to clear FB session on Adobe AIR

567 views
Skip to first unread message

vegetable182

unread,
Jul 19, 2012, 10:32:54 AM7/19/12
to facebook-act...@googlegroups.com
Hi,

Im trying the MediaUploadDemo but when I logout and  login again it automatically login the previous user. Now how I can clear the session so that each login is new?

Cheers.
Thanks a lot.

Fernando de França

unread,
Jul 28, 2012, 9:32:43 PM7/28/12
to facebook-act...@googlegroups.com
Same problem here. 

fjckls

unread,
Jul 30, 2012, 3:12:48 AM7/30/12
to facebook-act...@googlegroups.com
Here, this should do the trick:

var mysite:String = "http://yoursite.com";

private function logoutFromFacebook(e:MouseEvent):void 
{
var webView:StageWebView = new StageWebView();
webView.viewPort = new Rectangle(0, 0, 1, 1);
webView.stage = stage;
webView.loadURL("https://m.facebook.com/logout.php?confirm=1&next=" + mysite + "&access_token="+FacebookMobile.getSession().accessToken);
FacebookMobile.logout(logoutCallback,  mysite);
}
private function logoutCallback(response:Object):void 
{
if (response) {
trace("logged out for real");
}else {
        trace("smthng went wrong");
}
}

Fernando de França

unread,
Sep 4, 2012, 6:35:31 PM9/4/12
to facebook-act...@googlegroups.com
This works for me, except when the user closes the authorization window, so I can't get the accessToken.

How to log out without accessToken?

Tks!

nucky

unread,
Jul 1, 2013, 3:10:51 AM7/1/13
to facebook-act...@googlegroups.com

it appears we have to logout app and in the meantime use webVeiw clear the session.
if just use FacebookMobile.logout api and take a urlsite param,it does not work!

this is the source code,after my test, it fails.

 * @param appOrigin (Optional) The site url specified for your app. Required for clearing html window cookie.
*
*/
public static function logout(callBack:Function=null, appOrigin:String=null):void {
getInstance().logout(callBack, appOrigin);
}


.
在 2012年7月30日星期一UTC+8下午3时12分48秒,fjckls写道:
Reply all
Reply to author
Forward
0 new messages