Facebook app remains logged in after using Facebook SDK authentication - android

I have an app that uses Facebook SDK for fetching data such as user's friends, picture and so on.
After using the SSO feature, if the facebook app is installed on the device, it remains logged in, and gives notifications and so on.
I want to disable that - I just need to authenticate with my app and do simple facebook queries, I don't want the facebook app to open and stay in the background.
Any way to do that?

With the new Facebook SDK 3.0 there's a Session#close() method.

Related

Facebook and Instagram api to get all media of logged in user without SDK

I am into an android app where i need to develop features like when user login via Facebook or Instagram then this will get all videos/photos from Facebook or Instagram and save it on app server without using Facebook SDK. Facebook SDK will increase the size of the app, that we don't want so we need to do without SDK.
So my question is what steps i need to take to get all media from facebook and instagram server and save it on our app server when user login from our app but without SDK (just to avoid app size increment)
Thanks.

Unity Facebook sdk on android login permission issue

I am currently using the facebook sdk(for unity, not the android one) in my unity project.
the login basically works.
However there are two cases, whether the android device has the facebook app installed or not.
When the user logins with the facebook app installed, all the permission shows up properly:
user_friends,publish_actions,basic_info,public_profile
However when the app is not installed, the login is done through the web player. The login
works, but when it asks for permission, only the public_profile is shown. So in the game
I'am not able to bring the user friend list.
Does anyone have this issue..?
If you would like to get friend list, you have to request with graph api to get friend list something like "me?fields=id,name,friends"
Additionally, There is testing page for graph api. You can test graph api before using it what permission you gonna be needed
Check this out,
"https://developers.facebook.com/tools/explorer/145634995501895"

Facebook complete logout from android app that uses the Facebook SDK

I have a problem with the Facebook SDK for Android: basically I have an app X that uses the Facebook SDK to login (since I also have the "Facebook" app for Android installed on my smartphone, it uses its native login screen to access) .
In this way, if I login from my app X via facebook SDK, I find myself also logged in in the "Facebook" app for Android.
Now the question arises: if I want to disconnect from my app X (maybe because I want to change user or because I used the app on another phone not mine), the facebook SDK does not allow the total disconnection from FB, but only from my app X.
This is a problem because if I open the app "Facebook" for Android, I find myself still connected and if I close and reopen my app X, it notes that there is a FB session opened and It auto connect me with that user.
How can I make complete logout from FB from my app X?
Thanks
Ok, the only method to completely logout facebook is to disable SSO login and use the web version...
Just try to do the following: LoginManager.getInstance().setLoginBehavior(LoginBehavior.WEB_ONLY)
Pros: LoginManager.getInstance().logOut() works fine in this case.
Cons: the authentication will always appear in a webview dialog.

How to disable Single SIgn On for facebook android app?

I am building an application which needs user credentials for multiple users. If SSO is enabled, then I cannot logout the user (provided Facebook app is installed on the device) after using our application. The session persists, and the only method for logging out the user is via the facebook app, before the next user can login to our application.
So, I need the SSO disabled, so that it is independent of the facebook app on the device.
I have seen the problem being queried here: Disabling and Enabling Single Sign On in Facebook as Required
I know that in SDK 2.0, it could have been done using FORCE_DIALOG_AUTH, but in SDK 3.*, how do I go about it?
http://developers.facebook.com/docs/tutorials/androidsdk/3.0/upgrading-from-2.0-to-3.0/
P.S.: Any other method of making the login and logout independent of the facebook app will also work
See setLoginBehavior in the OpenRequest that you pass to Session.openFor[Read|Publish] - https://developers.facebook.com/docs/reference/android/3.0/Session.OpenRequest#setLoginBehavior%28SessionLoginBehavior%29
You can set it to SUPPRESS_SSO which will use the web dialog instead of SSO - https://developers.facebook.com/docs/reference/android/3.0/SessionLoginBehavior#SUPPRESS_SSO

How to get facebook authentication from Android login form

Is it possible to login into facebook using my own login form in Android & get the facebook user id? I just want to validate the users without need them access their facebook.
In the Android facebook tutorial, the app have to open facebook first so that user can login but there is no automatic close after user login successfully.
Thanks in advance
No, you don't have a way to log the user in through facebook without using their official endpoints.
You can open some sort of browser with the authentication dialog (or the open graph one) but that still mean using their forms/ui (what ever you want to call it).
You should just use the android sdk without using the SSO, that way the sdk won't call the facebook application that is installed on the device (if at all) and will just call the auth dialog for you.
This is a better solution for you since it "abstracts" some things from you, takes care of the access token and more.
Here's a thread about disabling the SSO: How to disable Facebook single sign on for android - Facebook-android-sdk

Categories

Resources