开发者

HTC FriendStream Facebook app interferes with my Android App Facebook login, how to force logout from facebook account clear cookies login cache

On an HTC phone with FriendStream app logged in, my App apparently skips providing a login to facebook due to FriendStream being logged in and I think its because it seems both apps call the web browser to do the login and likely it is cached?

How do I properly break the FriendStream connection so I can fo开发者_开发知识库rce a re-login with my App? Or is there a way for both to co-exist and both be logged on to different accounts if they both use the browser to negotiate the connection.

If there's a way to negotiate connection with facebook android sdk/api without using the browser and thus bypassing such issues would be good to know also. thanks!

Why does this code work on the emulator and other phones but on my phone with FriendStream App logged in to facebook it doesn't work?

Here is the code we use to log in to Facebook:

private void LoginToFacebook(){

facebook = new Facebook(APP_ID);

try {

facebook.logout(this);

}
catch (MalformedURLException e) {

// TODO Auto-generated catch block

e.printStackTrace();

}
catch (IOException e) {

// TODO Auto-generated catch block

e.printStackTrace();

}

SharedPreferences sharedPreferences = getApplicationContext().getSharedPreferences(
KEY, Context.MODE_PRIVATE);

facebook.setAccessToken(sharedPreferences.getString(TOKEN, null));

facebook.setAccessExpires(sharedPreferences.getLong(EXPIRES, 0));

facebook.authorize(this, PERMISSIONS, new LoginDialogListener());

}
//LoginToFacebook


As most Android devices are probably personal devices and Facebook considers itself a personal service, Facebook's Single-Sign-On is a nice way so the user does not have to log in for each Facebook-Connected App he uses (because usually he would use them with the same account anyway)

However, Facebook's API-SDK for Android does offer you a decent logout() method within the provided Facebook-Class which you can use, if you really want to force-sign-out the user. Due to the Single-Sign-On, the User should be logged out on all his SSO-Facebook-Applications, including FriendStream.

IMHO that might be a bit rude, though :)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜