2

I'm trying to integrate Facebook Manual Login Flow in an android app. The correct url to open the facebook login dialog as given on the page is:

https://www.facebook.com/dialog/oauth?
    client_id={app-id}
    &redirect_uri={redirect-uri}

However, this url always opens in the browser even if the facebook app is installed. Would it be possible to open the native app oauth dialog if it is installed without using the sdk? Is there any specific url/intent to open it?

The reason I'm going with the manual flow is because I don't want to include the entire Facebook Sdk just for using oauth2 and also I prefer to open the login dialog in the browser(if the app is not installed) than the webview dialog that is presented using the sdk.

Community
  • 1
  • 1
Suyash
  • 2,531
  • 2
  • 17
  • 29
  • An explanation for the downvote would be appreciated. – Suyash Nov 04 '15 at 16:05
  • You _should_ use the SDK. First of all, it makes for a more consistent user experience. And AFAIK only the parts of the SDK that you’re actually using are compiled into your final app file – it’s not as if the whole thing would be added if you only use the login features. – CBroe Nov 04 '15 at 16:45
  • 1
    @CBroe But wouldn't it be more secure to login through a browser than entering your password in a 3rd party app? Also many a times the user is already logged in in their preferred browser so it would also be more convenient for them. Isn't the point of oauth2 is to prevent users from entering their passwords in other apps? – Suyash Nov 04 '15 at 16:50
  • Problem is that the SDK login button does not show on mobile safari in IOS10 :( I'm encouraged to use a manual flow. Which forces me to use the php clientside flow. So, in order for the login to be picked up by the installed app I need to use the SDK, but in order to work on iOS10 I cannot use the SDK :( (see http://stackoverflow.com/questions/36984505/facebook-javascript-sdk-login-not-working-on-ios-best-practices-for-mobile#37186729) – Jos Mar 28 '17 at 15:10

1 Answers1

0

See point 7.2 of Facebook's Platform Policy: https://developers.facebook.com/policy/

"Native iOS and Android apps that implement Facebook Login must use our official SDKs for login."

If you're worried about app size, you can use proguard to strip out functionality that's not needed by your app. The SDK will also handle doing SSO through the native app, and gracefully falling back to a webview if the native app is not installed.

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