3

I have managed to get App Linking working for Android where it opens the app when opening the specified url.

I am opening the url https://fir-trial-66e3f.web.app/stripesub

However it asks me whether I want to use the app or google chrome to open the link, with the options "JUST ONCE" or "ALWAYS".

I want it to automatically open in the app the first time and to not ask the user.

I have tried following the instructions here (https://stackoverflow.com/a/34360396/10222449) by adding android:autoVerify="true" and I have verified my website. I did not need to upload the json file as it verified it automatically as I use the same google account as the firebase project owner.
However it still asks the same question.

I am using an Ionic app with Capacitor, however I don't think that is related to the issue.

AndroidManifest.xml

            <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="fir-trial-66e3f.web.app"
                    android:pathPrefix="/stripesub" />
            </intent-filter>

Resources I used: https://developer.android.com/studio/write/app-link-indexing https://developer.android.com/training/app-links/index.html

MadMac
  • 4,048
  • 6
  • 32
  • 69
  • I figured this out. Even though it auto verified me I still needed to generate the json file from within Android studio and copy to: https://myurl/.well-known/assetlinks.json. I also needed to copy and paste it into notepad due to end of line issue (I think) and I put a carriage return at the end of the json or it wasn't working. https://stackoverflow.com/a/44549183/10222449 If anyone is interested let me know and I will put up an answer. – MadMac Dec 03 '19 at 04:27

1 Answers1

0

Even though it auto verified me at search.google.com I still needed to generate the json file from within Android studio and copy to: myurl/.well-known/assetlinks.json.

To do this go to Android Studio -> Tools -> App Links Asssistant -> Step 3 Associate Website

I also needed to copy and paste it into notepad due to end of line issue (I think) and I put a carriage return at the end of the json or it wasn't working.

See: https://stackoverflow.com/a/44549183/669586

Sulthan
  • 128,090
  • 22
  • 218
  • 270
MadMac
  • 4,048
  • 6
  • 32
  • 69