androidhtmlkotlindeeplink

Why Deeplink not working when I am using my custom Host and schema?


I am trying open my app by clicking a link from browser. Its working fine and got the pathPrefix as well when I am using below host and schema which i tried from test sites. The same thing I just changed my host to my application it was not working and its loading in the browser itself.

This one I tried from some site.

     android:host="dolap.com"
     android:scheme="https"
     android:pathPrefix="/id"/>

and the html tag is here

<a href="https://www.dolap.com/id=1001">Visit our HTML tutorial</a>

My server host i used is

     android:host="ledhis.in"
     android:scheme="https"
     android:pathPrefix="/id"/>

and the html tag is here

<a href="https://www.ledhis.in/id=1001">Visit our HTML tutorial</a>


Solution

  • Your code is not enough. So can't say where exactly you have a problem.

    Read and follow this instructions: https://medium.com/@muratcanbur/intro-to-deep-linking-on-android-1b9fe9e38abd

    I followed these steps and everything worked fine. If you will have some problems - just let me know

    Update

    Add this code to your manifest file to that activity which will receive the deep link call:

     <intent-filter>
                <action android:name="android.intent.action.VIEW" />
    
                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.BROWSABLE" />
    
                <data android:scheme="http"
                    android:host="www.example.com"
                    android:pathPrefix="/gizmos" />
            </intent-filter>
    

    Then add intent check:

    Intent intent = getIntent();
    Uri data = intent.getData();
    

    Add a button to your view that will share your link so you can test it. Even how you will test it. I didn't find any test logic inside your code.

    Also check this 2 links:

    Part 1: https://android.jlelse.eu/deep-linking-in-androd-9c853573fdf4

    Part 2: https://android.jlelse.eu/deep-linking-in-android-part-2-23e942293032