android - 为什么 Facebook 登录页面无法在 Android 11 的外部浏览器中打开?

标签 android facebook

长期以来,我们已经在我们的应用程序中集成了 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"/>
疑难解答:
  • 我没有设置这个:LoginBehavior=WEB_VIEW_ONLY
  • 我的 Android 11 设备中有最新的 chrome 默认浏览器
  • 我没有安装 Facebook 应用程序
  • 在下面,我检查了文档,但不确定与自定义选项卡相关的要求

  • 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/

    相关文章:

    java - 如何回收 LinearLayout 中的 View ,以避免多次调用 findViewById()?

    java - 如何在java中为android获取El​​ementById

    android - 如何创建具有所需宽度和长度段数的网格/平面?

    javascript - 网站可以知道我是否在运行用户脚本吗?

    android - 在 android 中分享到 Facebook(如 twitter)

    Facebook 广告洞察 API : (#3) Application does not have the capability to make this API call

    Android Studio 支持库 v7

    java - 在 ListView 中显示 HashMap 中的特定项目

    iphone - 在 Facebook 上使用 sharekit 共享多个项目

    ios - alloc 和 facebook init 的问题