0


i have this url https://myportal.net/#!/search/main/34 i need to implemnt deep linking when user click on the url its open the app.

Note: 34 number is changing in the url

i do the following but its not working

 <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>
2
  • Try using the App Links Assistant of Android Studio: Tools > App Links Assistant. It will help you to check if the pattern is correct or not
    – BMacedo
    Dec 30, 2019 at 10:25
  • thank you i solve the issue by android:pathPattern="/.*" to support open app Jan 2, 2020 at 8:43

1 Answer 1

1

In Your Splash Activity

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("");
    });`
}

In your Manifiest file

<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>
1
  • thank you i solve the issue by android:pathPattern="/.*" to support open app Jan 1, 2020 at 19:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.