2

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>

IamVariable
  • 408
  • 6
  • 23

1 Answers1

1

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

Edhar Khimich
  • 1,468
  • 1
  • 17
  • 20
  • I used the same site which you referred. You can find my app here. https://github.com/MuthuHere/AndroidDeeplinks thanks for your time and help in advance. – IamVariable Jun 25 '19 at 03:32
  • great working excellent when i create a html file for this URL. What to do if I tap the same url from message or from any Notes app. Means, I have the same URL (http://www.example.com/gizmos) in my notes. If i tap on this, it directly goes to browser instead of going to my app. Any idea? Thanks! – IamVariable Jun 25 '19 at 23:06
  • Maybe you check " Remember always" for browser from the beginning ? – Edhar Khimich Jun 25 '19 at 23:30
  • i did that too. but still same:( – IamVariable Jun 26 '19 at 01:56
  • Check this example: https://tune.docs.branch.io/sdk/deep-linking-to-your-mobile-app-from-your-website/ Because you need to create special body in html if you want to use deeplinks. – Edhar Khimich Jun 26 '19 at 03:06