0

I'm a french guy so please excuse my english !

I'm developping an App Android and I want to allow my users to connect us via Facebook. BUT ! But, I want to "force" the code to use the facebook web and not to launch the facebook application !

Am I clear ? :)

Thanks a lot !

Florian Mac Langlade
  • 1,863
  • 7
  • 28
  • 57
  • Also ... http://stackoverflow.com/questions/12084372/android-how-can-i-force-a-facebook-auth-by-mobile-web – Fattie May 05 '14 at 08:03

2 Answers2

2

Generally, it's not recommended to use ONLY the webview for login, so unless you have a very specific use case, you should always use SSO.

That said, you can disable SSO by passing in SessionLoginBehavior.SUPPRESS_SSO to a Session.OpenRequest.

First, you need to familiarize yourself with the Facebook SDK for Android. Make sure you go through the Getting Started Guide, and then the Using Facebook Login tutorial.

Following the tutorial, if you're using the LoginButton, then you can just call

LoginButton authButton = (LoginButton) view.findViewById(R.id.authButton);
authButton.setLoginBehavior(SessionLoginBehavior.SUPPRESS_SSO);

in your onCreateView() method.

Ming Li
  • 15,672
  • 3
  • 37
  • 35
0

If you do not need to auto login for the user, then just fire an intent which starts the web browser and goes to the facebook login page.

aandroidtest
  • 1,493
  • 8
  • 41
  • 68
  • Yes ! This is that I need !! Do you know how can I do that ? :/ Thanks :) – Florian Mac Langlade Jan 23 '13 at 08:57
  • It's not that simple, because you need to intercept the response, and extract details in order for your app to connect to Facebook. Please see my updated answer above. – Ming Li Jan 23 '13 at 17:23
  • @Florian Mac Langlade See here: http://stackoverflow.com/questions/3004515/android-sending-an-intent-to-browser-to-open-specific-url – aandroidtest Jan 24 '13 at 14:46