我有这个网址https://myportal.net/#!/search/main/34,当用户单击该网址打开应用程序时,我需要禁止深度链接。
注意:网址中的34个数字正在更改
我执行以下操作,但不起作用
<activity
android:name="ui.Activities.SplashActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:theme="@style/SplashScreen">
<intent-filter android:label="@string/app_name">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data
android:host="${hostName}"
android:pathPattern="/.*/.*/.*/.*"
android:scheme="https" />
</intent-filter>
答案 0 :(得分:1)
在您的启动活动中
private void handleDeepLink(Intent intent) {
FirebaseDynamicLinks.getInstance()
.getDynamicLink(intent)
.addOnSuccessListener(pendingDynamicLinkData -> {
// Get deep link from result (may be null if no link is found)
Uri deepLink;
String finalLink = "";
if (pendingDynamicLinkData != null) {
deepLink = pendingDynamicLinkData.getLink();
String string = String.valueOf(deepLink);
String decodeUrl = Utils.decodeUrl(string);
String[] parts = decodeUrl.split("main/");
String part1= parts[0];
String part2= parts[1];
finalLink = part2.replaceAll(" ", "+");
Log.w("dynamiclink", finalLink);
if (!Validator.isEmptyString(finalLink)) {
getDataManager().setAuthSecret(finalLink);
}
}
getNavigator().openRegistrationActivity(finalLink);
})
.addOnFailureListener(e -> {
getNavigator().openRegistrationActivity("");
});`
}
在您的Manifiedt文件中
<intent-filter android:autoVerify="true">
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<action android:name="android.intent.action.VIEW" />
<data
android:host="nms-rx.in"
android:pathPrefix="main/"
android:scheme="https" />
</intent-filter>