当我点击twitter上的branch.io deeplink时,我的应用程序没有出现

时间:2017-11-01 10:55:10

标签: android deep-linking branch.io

在Twitter中共享深层链接(branch.io)并单击它后,我的应用程序不是打开它的选项类型。只有浏览器在那里。这是Twitter的行为还是我身上的任何错误?

我的清单文件:

<receiver
            android:name="com.indiatoday.util.TwitterIntegrationHelper$MyResultReceiver"
            android:exported="false">
            <intent-filter>
                <action android:name="com.twitter.sdk.android.tweetcomposer.UPLOAD_SUCCESS" />
                <action android:name="com.twitter.sdk.android.tweetcomposer.UPLOAD_FAILURE" />
            </intent-filter>
        </receiver>
        <service
            android:name=".util.DownloadService"
            android:enabled="true"/>

        <meta-data
            android:name="io.fabric.ApiKey"
            android:value="xxx" />

        <meta-data
            android:name="com.facebook.sdk.ApplicationId"
            android:value="@string/facebook_app_id" />

        <meta-data
            android:name="io.branch.sdk.BranchKey"
            android:value="key_test_xxx" />

2 个答案:

答案 0 :(得分:0)

确保为您的活动添加了意图过滤器,如下所示,同时确保按照app中提到的android:host配置分支网址主机

     <intent-filter>
            <data
                android:host="abc.app.link"
                android:scheme="https" />

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

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

答案 1 :(得分:0)

为了让您的应用显示在Open in选项菜单中,您需要设置应用以支持应用链接。

您可以阅读Android官方文档here上的应用程序链接。

为了使用Branch设置应用程序链接,

  1. 在您的分支仪表板上,您需要在链接设置中查看Enable App Links并添加SHA256证书。
  2. 在Android Manifest中,将Intent过滤器添加到要支持App链接重定向的Activity

     <!-- Branch App Links (optional) -->
     <intent-filter android:autoVerify="true">
         <action android:name="android.intent.action.VIEW" />
         <category android:name="android.intent.category.DEFAULT" />
         <category android:name="android.intent.category.BROWSABLE" />
         <data android:scheme="https" android:host="example.app.link" />
         <data android:scheme="https" android:host="example-alternate.app.link" />
    </intent-filter>
    
  3. example.app.link替换为分支仪表板中的链接域。