我们正试图为使用branch.io的安卓系统创建一些深层次的链接,但在过去的两天里没有取得任何成功。如果我们能在如何做这件事上得到一些帮助,我们会非常高兴的。
配置:
Android宣言:
<activity
android:name=".login.view.DeepLinkActivity"
android:screenOrientation="portrait"
android:theme="@style/AppTheme.Login"
android:windowSoftInputMode="adjustResize">
<intent-filter>
<data android:scheme="myapp" android:host="open" />
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
</intent-filter>
</activity>Branch.io仪表板:
在android重定向部分中,"Android模式“的值设置为"myapp://”
该链接是通过branch.io HTTP生成的。职位要求是
host: v1/url
request body:
{
"alias":"xxxx",
"data":"{\"$fallback_url\":\"www.xxx.com\",\"$android_depplink_path\":\"myapp://open/\"}",
"branch_key":"key_test_xxxxxxxxxx"
}每当我们试图通过电子邮件打开这个链接,我们就被重定向到在branch.io仪表板中定义的回退网址。
请帮助我们把这个配置正确。
发布于 2016-11-13 08:37:36
您需要重写启动程序Activity的Activity方法,并根据从意向传递的数据处理重定向。
步骤1:使用https://dev.branch.io/getting-started/creating-links/apps/android/#generate-the-link生成深度链接
步骤2:处理意图并采取所需的活动https://dev.branch.io/getting-started/deep-link-routing/guide/android/#building-a-custom-deep-link-routing-method
不要忘记在android:launchMode="singleTop"声明中添加Activity,一次只有一个实例。您还可以使用intent.addFlag()传递Intent.FLAG_ACTIVITY_REORDER_TO_FRONT和Intent.FLAG_ACTIVITY_CLEAR_TOP来处理这个问题。希望这能有所帮助。
https://stackoverflow.com/questions/40213328
复制相似问题