Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/apache-spark/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 分支深度链接未打开应用程序_Android_Branch.io - Fatal编程技术网

Android 分支深度链接未打开应用程序

Android 分支深度链接未打开应用程序,android,branch.io,Android,Branch.io,我正在尝试向我的应用程序添加Branch.io深度链接。我在应用程序中生成的链接重定向到网站,而不是启动应用程序。我注意到,当我手动打开应用程序后,它会导航到我希望通过深度链接打开的活动。我通过Fabric kit添加了Branch.io,并遵循Fabric中关于深度链接路由的逐步教程。我的应用程序还不在Google Play商店中 这是我在网站上的配置(我还选中了选项:始终尝试打开应用程序和仪表板顶部的测试模式)。我正在生成的链接也应该是test,因为我在BranchSDK:response/

我正在尝试向我的应用程序添加Branch.io深度链接。我在应用程序中生成的链接重定向到网站,而不是启动应用程序。我注意到,当我手动打开应用程序后,它会导航到我希望通过深度链接打开的活动。我通过Fabric kit添加了Branch.io,并遵循Fabric中关于深度链接路由的逐步教程。我的应用程序还不在Google Play商店中

这是我在网站上的配置(我还选中了选项:
始终尝试打开应用程序
和仪表板顶部的
测试
模式)。我正在生成的链接也应该是test,因为我在
BranchSDK:
response/request中看到了
testkey

AndroidManifest.xml

    <application
    android:name=".app.MainApplication"
    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:largeHeap="true"
    android:supportsRtl="true"
    android:theme="@style/AppTheme">

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

    <activity
        android:name=".ui.main.MainActivity"
        android:label="@string/app_name"
        android:launchMode="singleTask"
        android:screenOrientation="portrait">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>

        <intent-filter>
            <data
                android:host="open"
                android:scheme="example" />
            <action android:name="android.intent.action.VIEW" />

            <category android:name="android.intent.category.DEFAULT" />
            <category android:name="android.intent.category.BROWSABLE" />
        </intent-filter>
主要应用

@Override
public void onCreate(){
    super.onCreate();
    Fabric.with(this);
    Branch.getAutoInstance(this);
}

如果需要,我可以添加更多的代码片段。

Alex from Branch.io,请点击此处:

因为当您单击链接后手动启动应用程序时,应用程序会导航到正确的活动,这意味着您的大多数配置都是正确的。唯一似乎缺失的是触发应用程序实际启动的代码

在Android上,Branch使用您的URI方案来实现这一点。这就是代码的这一部分:

<intent-filter>
    <data
        android:host="open"
        android:scheme="example" />
    <action android:name="android.intent.action.VIEW" />

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

分支仪表板的一部分


这应该足够让你在这里跑起来了。你可能还想看看我们的网站。Fabric指南是一个很好的入门方式,但它们只涵盖了Branch提供的一小部分功能

如果接受的解决方案不适用于您,请尝试检查顶部的
始终尝试打开app
选项。

我将生成的链接中的
https
更改为
http
,它开始工作。这一点很好。我不知道在
scheme
字段中写什么。我建议您删除文档中的
示例
单词,并添加一个更清晰的字符串,如
http://your.example.scheme/for.links
,因为人们会感到困惑,不知道在那里写什么。谢谢
<intent-filter>
    <data
        android:host="open"
        android:scheme="example" />
    <action android:name="android.intent.action.VIEW" />

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