1

I am trying to implement an AppLink (deeplink) such that when the app-link is triggered it does not bring up the popup asking for my App or Chrome, I want it to just launch my app so I can direct them to the proper place in the app.

I have read various android articles and posts and cannot get the AppLink to work the way I want.

Here is my manifest xml:

        <activity android:name=".MainActivity">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
        <intent-filter android:autoVerify="true">
            <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" />
        </intent-filter>
        <intent-filter android:autoVerify="true">
            <action android:name="android.intent.action.VIEW" />

            <category android:name="android.intent.category.DEFAULT" />
            <category android:name="android.intent.category.BROWSABLE" />

            <data
                android:scheme="https"
                android:host="www.example.com" />
        </intent-filter>
    </activity>

I read in the android doc here the following:

A deep link is an intent filter that allows users to directly enter a specific activity in your Android app. Clicking one of these links might open a disambiguation dialog, which allows the user to select one of multiple apps (including yours) that can handle the given URL. For example, figure 1 shows the disambiguation dialog after the user clicks a map link, asking whether to open the link in Maps or Chrome.

Android App Links are a special type of deep link that allows your website URLs to immediately open the corresponding content in your Android app (without requiring the user to select the app).

I added auto verify to the intent and have the assetlinks.json file but still prompts to choose my app or chrome. I DO NOT want the prompt for chrome... only my app.

So, what am I missing?

Has anyone here got an app link to work that DOES NOT pop up the option for Chrome?

Can anyone point me to a sample app or code or an article that actually works?

Thanks for any assistance with this.

LilMoke
  • 3,176
  • 7
  • 48
  • 88
  • Please, share assetlinks.json file. Also, you should know that Android system verifies association only once on app first launch after install. Check your assetlinks.json and if it's correct try reinstall your app. – Николай Гольцев Oct 27 '20 at 03:58
  • I looked at my assettlinks file and ran the test in android studio and that seems to be ok. What did you mean by, "Android system verifies association only once on app first launch after install" – LilMoke Oct 27 '20 at 12:23
  • It means Android system makes an attempt to create association only once when user installs your app and run it for the first time. If you make a mistake during setup app link and then install your app for example on emulator, run it, and after it you correct configuration (change app link intent filter or upload new assetlinks.json file to your site) then to force Android attempt to create association and verify it you need to reinstall app. – Николай Гольцев Oct 27 '20 at 12:55
  • Ahh, yes, I got that... thank you! So, one question, once I get this to work, will I be able to go into chrome and enter the url, for example, http://myApp.somehere.com/doSomthing and have it open my app? – LilMoke Oct 27 '20 at 13:02
  • Yes, you will. One thing is that you should use same url as defined in intent filter in the AndroidManifest.xml. In your case is ```http://www.example.com/``` or ```https://www.example.com/```. – Николай Гольцев Oct 27 '20 at 13:11
  • Thank you SOO MUCH for the help. I am sorry we are going back and forth. It simply does not work,. I have verified that the test passes with the assettlinks file, manually checked it and it appears correct. I have verified the URLS match the manifest. I have wiped the data on the sim and re-installed. But, when I run the test from Android Studio, I get the prompt for my app and chrome. If I choose chrome to tries to go to the link and does not launch my app. If I choose my app it works fine. If I got into chrome manually and type the url; it tries to open the url. Any other thoughts? – LilMoke Oct 27 '20 at 13:21
  • I suggest you check each of rule listed here: https://developer.android.com/training/app-links/verify-site-associations#publish-json. There is a section "Be sure of the following". – Николай Гольцев Oct 27 '20 at 13:30
  • LOL, thank you, that article was already up on my screen. I will go through it again and hopefully I will have some success. I will update my post should I have any more specific questions. – LilMoke Oct 27 '20 at 13:38
  • 1
    UGGHHH, This bus SOOO Frustrating. I have checked, rechecked, I get GREEN on all tests I find. BUT it always brings up the app and chrome choice, CHROME will not bring me to my app. I have not even found a working sample that I can get to work. – LilMoke Oct 27 '20 at 18:05
  • Can you provide test details? OS version, phone (brand and model) or emulator. Also, you can give some extra test details which might be helpful. – Николай Гольцев Oct 27 '20 at 18:42
  • @LilMoke did you have others intent filters with category browsable and http or https as schema in your Manifest? – ilbose Apr 26 '21 at 08:46

0 Answers0