第一次点击时,应用程序无法从Facebook App Link Deep LInk启动

时间:2015-08-02 01:00:32

标签: android facebook android-intent deep-linking

我通过我创建的网页与我的应用程序有很深的链接,我使用Facebook SDK创建并发布到Facebook开放图表。但是,第一个点击帖子的人会被定向到浏览器而不是我的应用程序。在第一个人打开帖子后,其他用户被正确定向到该应用程序。

网页HTML是这样的:

    <html> <head> 
    <meta property="al:android:url" content="myapp://0B6JA7WLVQukweEJ4OWFQbjJqWkU" > 
    <meta property="al:android:package" content="com.blah.myapp" > 
    <meta property="al:android:app_name" content="App Name" > 
    <meta property="al:web:should_fallback" content="true" > 
    <meta property="og:title" content="Post Title" > 
    <meta property="og:type" content="website" > 
    <meta property="og:url" content="https://36197da29a77a6423e7262ff078abc3e5002454b.googledrive.com/host/0B6JA7WLVQukwZGdsUXRaV190cDg"> 
    </head> 
    <body> Test Post
    </body> 
    </html>

当我使用Open Graph Object Debugger检查它时,没有错误和App Link - Android数据似乎正确,没有我可以看到的拼写错误或错误,它显示的网址为myapp://...。当我点击帖子作为第一个用户时,我在调试输出中看到以下内容:android.intent.action.VIEW dat=https://36197da29a7...当我看到android.intent.action.VIEW dat=myapp://...

1 个答案:

答案 0 :(得分:0)

您必须将此添加到您的启动器活动才能在您的应用中处理深层链接..

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

            <category android:name="android.intent.category.DEFAULT" />
            <category android:name="android.intent.category.BROWSABLE" />
            <!-- Accepts URIs that begin with "https://36197da29a77a6423e7262ff078abc3e5002454b.googledrive.com -->
            <!-- It will also work for app indexing: android-app://36197da29a77a6423e7262ff078abc3e5002454b.googledrive.com -->
            <data
                android:host="36197da29a77a6423e7262ff078abc3e5002454b.googledrive.com"
                android:scheme="https" />
        </intent-filter>