Android - Open Facebook app for Logout - android

Is it possible to open Facebook App for logout or logout another way from it if I've login in my app with SSO and now I want to logout?

No, but you can force facebook auth dialog to show next time user tries to log in into your app even though he still would be logged in under his account in Facebook app at that moment.
facebook.authorize(activity, FACEBOOK_PERMISSIONS, Facebook.FORCE_DIALOG_AUTH, facebookDialogListener);

Related

How to check if the same user in facebook app is logged in my app

I am developing an app where user can be different at different times. My app allows login with facebook. Integration and all works perfectly but i got stuck at a point.
Following is the scenario:
user_a logged into my sample app with facebooksdk-> same user logged in Facebook app (In android mobile), now i show the connected status to the user in my app.
Now, I will change the user in facebook app and i will re-open my sample app. Here it is still showing the old user. In this place i have sync between facebook app user and my sample app user and if different i have to force Logout user from my app and ask him to login again. Please let me know what i am missing. Thanks
I have tried ProfileTracker as well as AccessTokenTracker but these both getting executed only if user logged out from my app .

How to clear Firebase authdata on Facebook App revoke?

I am following the login with Facebook example for my app from here.
I have a question regarding one of the login test cases as mentioned on facebook. Here is the scenario:
First time user comes, sees the login to facebook button
Successfully logs in, sees and approves the facebook(fb) app permission screen, and I get the authdata, and some other info
User closes the app
User directly goes on Facebook and revokes the access to the fb app, approved in Step 2.
User opens the mobile app, and still able to use it, without getting the facebook login button..?
Ideally I would like to see the login button again.
How do we handle such a scenario with Firebase and Facebook together? Do I need to check something on every app restart and what all things I need to clear before new login starts?

Choose account for Facebook android login?

I've followed the Facebook dev login tutorial for Android, to get my app to the point that the login/logout widget (from FB) works and I can login and log out of my Facebook account. However, it is dependent on my android Facebook application account logged in at the time.
I can't actually enter login details from within my app if I logout and try relog- it automatically just logs me in with my account? So it just uses which ever one is logged in, with the android Facebook app. If I log out of the android FB app it brings up the login screen (asking for details) in my app, but I don't want to have to do that. Is there anyway get my app to ask for login details if I logout from within the app?
I've looked at How to log in with other facebook account? and How to disable Sandbox Mode for app in new Facebook Developer? but had no luck.

Once I have shared something from my android app, How to logout from face book in my application?

I have developed a game on unity 3d for android that has the functionality to share the score on Facebook. If I am not logged in to the native android facebook app then my game asks the user to sign in by opening the facebook sign in page. once user is signed in his score is shared on the facebook on his wall.
Ok now the problem is after all that I have mentioned above, I logout the facebook. And when again I try to share the score on facebook my game opens the last user's facebook account. That should not happen, If I have logged out , my game should reopen the facebook login page and ask me to sign in again... What should I do to remove the last used account from my game? Any suggestions?
You cannot explicitly log the user out from the Facebook app, only from your own app.
In your specific use case, you can potentially use SessionLoginBehavior.SUPPRESS_SSO when you're opening the session, which forces a web dialog for login, and does not use the Facebook app.

Logout of my app if logged out of facebook app

I have an app that uses facebook connect. When it has to login to facebook it opens up the android app on the phone. But after that the app works independently of facebook. What I want to do is that if the user logs out of facebook on the facebook app my app should also sign out autmomatically. How can this be done?
There is no way to get notified if a user is logged out of the facebook app. The only thing you can do is to clear the facebook OAuth token everytime your application is closed.
This way the user would have to go through the facebook login process every time she opens the app. If the facebook app is logged in this will be very fast. If the user is logged out she will have to log in in facebook again to use your app.

Categories

Resources