长期以来,我们已经在我们的应用程序中集成了 Facebook 登录。现在 Facebook 正在制作 webview更改,该登录页面应在外部浏览器中打开,并且需要 SDK 8.2.0,并且他们还添加了一些需要满足的条件。
代码:
<meta-data
android:name="com.facebook.sdk.ApplicationId"
android:value="@string/facebook_app_id" />
<activity
android:name="com.facebook.FacebookActivity"
android:label="@string/app_name"
android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation"/>
疑难解答:Ensure that your app has configured support for Custom Tabs properly. (For more information on Custom Tabs, see the Custom Tabs documentation.) To test your configuration:
尝试了以下两个选项,但没有运气!
Option 1 Ensure your app is using version 8.2.0 or later of the Facebook SDK for Android. If so, you should not need to make any modifications to your Android manifest. If you have any items referencing “CustomTabMainActivity” or “CustomTabActivity”, remove them.
Option 2 Configure your Custom Tabs intent filter exactly following the instructions in the "Edit Your Resources and Manifest" step of the Facebook Login for Android - Quickstart.
任何其他建议将不胜感激。谢谢。
最佳答案
Android 版本 11 现在需要在 AndroidManifest.xml 中具有查询权限才能在外部浏览器中打开 Web url。我不确定这一点,但值得一试。
更多信息 here .
这是示例 list 。
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.example">
<uses-permission android:name="android.permission.INTERNET" />
<queries>
<intent>
<action android:name="android.intent.action.VIEW" />
<data android:scheme="http"/>
<category android:name="android.intent.category.DEFAULT" />
</intent>
<intent>
<action android:name="android.intent.action.VIEW" />
<data android:scheme="https"/>
<category android:name="android.intent.category.DEFAULT" />
</intent>
</queries>
<application
...
关于android - 为什么 Facebook 登录页面无法在 Android 11 的外部浏览器中打开?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/69394097/