'Facebook login not working with facebook application
I am coding for the Login with the Facebook
into my android application.I am following this STEPS.
I have problem that The logout button is not showing after login, it still displayed me login button. This problem is occure when I install the facebook app into emulator, but without install facebookapp it's working.
After install Facebook Application :
- Press on the login button(From my application)
- If not login then redirect to the facebook app
- After login into facebook app back to my app and don't show me logout button but instead of logout it show me login button
Without install Facebook app : [This is working as I want]
- press the login button(from my application)
- Redirect to the facebook page (I don't know about this page)
- After login success back to my app, and show logout button.
Now In short, I want second senario same for the First Senario.
Thanks.
Solution 1:[1]
You may want to use FORCE_DIALOG_AUTH while facebook.authorize
facebook.authorize(HomeTab.this, new String[] {"publish_stream"}, Facebook.FORCE_DIALOG_AUTH,new Facebook.DialogListener() {
As you can see third parameter use FORCE_DIALOG_AUTH.
Solution 2:[2]
old but, in section with LoginButton authButton = (LoginButton) view.findViewById(R.id.authButton); add
authButton.setLoginBehavior(SessionLoginBehavior.SUPPRESS_SSO);
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Amit Hooda |
Solution 2 | Eugene Pinchuk |