【发布时间】:2016-10-11 15:21:40
【问题描述】:
我正在尝试将 Branch.io 深度链接 添加到我的应用程序中。我在应用程序中生成的链接重定向到网站而不是启动应用程序。我注意到,当我手动打开应用程序后,它会导航到我想通过 Deep Link 打开的 Activity。我通过 Fabric 工具包添加了 Branch.io,并按照 Fabric 中关于 深度链接路由 的分步教程进行操作。我的应用尚未出现在 Google Play 商店中。
这是我在网站上的配置(我还选中了选项:Always try to open app 和Test 仪表板顶部的模式)。我生成的链接也应该测试,因为我在BranchSDK: 响应/请求中看到了test key
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>
构建.gradle
//...
applicationId "com.example"
//...
compile('io.branch.sdk.android:library:2.4.3@aar') {
transitive = true;
}
主应用程序
@Override
public void onCreate(){
super.onCreate();
Fabric.with(this);
Branch.getAutoInstance(this);
}
如果需要,我可以添加更多代码 sn-p。
【问题讨论】: