我将我的应用配置为在Branch.io文档中提到的深层链接。以下是我的配置
的Manifest.xml
<intent-filter
android:autoVerify="true">
<data android:scheme="trupik" android:host="open" />
<data android:scheme="trupik" android:host="https" />
<data android:scheme="https" android:host="trupikconnect.app.link" android:pathPrefix="/x2ms"/>
<data android:scheme="https" android:host="trupik.com" android:pathPrefix="/x2ms"/>
<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 onStart() {
super.onStart();
Branch branch = Branch.getInstance();
branch.initSession(new Branch.BranchReferralInitListener() {
@Override
public void onInitFinished(JSONObject referringParams, BranchError error) {
if (error == null) {
// params are the deep linked params associated with the link that the user clicked before showing up
Log.i("BranchConfigTest", "deep link data: " + referringParams.toString());
}
}
}, this.getIntent().getData(), this);
}
@Override
public void onNewIntent(Intent intent) {
this.setIntent(intent);
}
我在分支仪表板中的url scheme是trupik:// 注意:包名称也相同。
我的问题是当我点击链接应用程序未被打开时,即使它已安装
答案 0 :(得分:1)
<intent-filter
android:autoVerify="true">
<data android:scheme="trupik" android:host="open" />
<data android:scheme="https" android:host="trupikconnect.app.link" />
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
</intent-filter>