Facebook手动登录流程,如果已安装,则在应用程序中打开登录对话框 [英] Facebook manual login flow, open login dialog in app if installed

查看:139
本文介绍了Facebook手动登录流程,如果已安装,则在应用程序中打开登录对话框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试集成 Facebook手动登录Flow 在Android应用中.如页面上所示,打开Facebook登录对话框的正确URL为:

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}

但是,即使安装了facebook应用程序,该URL也会始终在浏览器中打开.如果未使用sdk进行安装,是否可以打开本机应用程序oauth对话框?是否有任何特定的网址/意图打开它?

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?

我采用手动流程的原因是因为我不想仅使用oauth2就包括整个Facebook Sdk,而且我更喜欢在浏览器中打开登录对话框(如果未安装该应用程序)比使用sdk呈现的webview对话框要好.

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.

推荐答案

请参阅Facebook平台政策的第7.2点: https ://developers.facebook.com/policy/

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."

如果您担心应用程序的大小,可以使用proguard去除应用程序不需要的功能.该SDK还将通过本机应用程序处理SSO,如果未安装本机应用程序,则可以优雅地退回到Web视图.

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.

这篇关于Facebook手动登录流程,如果已安装,则在应用程序中打开登录对话框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆