【问题标题】:Facebook prevent my app from opening by a link androidFacebook阻止我的应用程序通过链接android打开
【发布时间】:2018-10-15 11:56:03
【问题描述】:

我正在尝试通过链接打开我的应用 我成功了,我可以从链接打开它,但是如果我在 facebook 应用程序上打开它.. 它用它的 webview 打开它,所以我不能通过它从 facebook 的链接打开我的应用程序,这就是我的清单中的内容

 <intent-filter>
                <data
                    android:host="example.com"
                    android:pathPrefix="/users"
                    android:scheme="http" />

                <action android:name="android.intent.action.VIEW" />

                <category android:name="android.intent.category.BROWSABLE" />
                <category android:name="android.intent.category.DEFAULT" />


            </intent-filter>

谢谢

【问题讨论】:

    标签: android android-intent intentfilter


    【解决方案1】:

    尝试删除此行

    <category android:name="android.intent.category.BROWSABLE" />
    

    【讨论】:

    • 对于“从链接打开”的意图来说,这不正是应该存在的吗?
    • @domen 是的,但是要从浏览器 url 打开应用程序,而不是从其他应用程序
    • 但是为什么将它放在 BROWSABLE 类别中会限制这种行为呢?您有任何参考资料和/或您尝试过吗?
    • 谢谢,但是..它也没有工作,并给我这个消息支持 ACTION_VIEW 的活动未设置为 BROWSABLE
    • 任何其他解决方案:)
    【解决方案2】:

    这可能会解决问题:

    <data android:pathPattern="/.*" />
    

    所以意图过滤器看起来像:

    <intent-filter>
            <action android:name="android.intent.action.VIEW" />
            <category android:name="android.intent.category.DEFAULT" />
            <category android:name="android.intent.category.BROWSABLE" />
            <data android:host="example.com" />
            <data android:scheme="https" />
            <data android:pathPattern="/.*" />
    </intent-filter>
    

    如果您为http://myexample.com 注册您的意图并单击http://myexample.com/blah,它将不起作用。

    【讨论】:

    • 对不起,但它也不起作用..看看我是否用任何浏览器打开它,它将直接在应用选择器中获取我的应用,但如果我从 facebook 浏览器打开它,它不会给我机会选择我的应用
    • 你应该在facebook开发者控制台上问这个问题
    猜你喜欢
    • 2022-07-11
    • 1970-01-01
    • 1970-01-01
    • 2019-12-21
    • 2019-09-14
    • 2016-04-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多