Issue
We are developing a brand new application and as with many applications during registration of your account you will receive an email with an activation button inside.
The link behind the button is something like https://links.mydomain.dev/activate/somecodeorso. The application is configured to intercept all URLs from https://links.mydomain.dev. And if we pass this link around in our chat applications upon clicking it asks to either open our application or to open in the browser.
However on Android we tested with a Gmail account mostly and from within GMail an embedded browser is started and our link is opened in there and just opens the 'fallback' page on which we redirect you the play or app stores. So I know that my app is configured correctly to intercept the URLs. So the problem is not related to the app.
I also know that in GMail I can disable the embedded browser, but that is off course just for me, lots of our potential users will have the flag unmodified and off course we cannot ask them to switch this settings either. But on that same device I tested with other services (last one I tested for instance was Tricount) and their emails all have regular URL behind it, but instead of launching the embedded browser it asks to open either the app or the regular browser.
So now the question is off course, what am I doing wrong. Is there anything special I should do to make the links open in the app (or at least let the OS ask me what to do with it)?
Any help would be largely appreciated!
Solution
Thanks to @CommonsWare I started looking into some other APK's and there were a few differences I could find out.
One of the differences was inside the querty block:
<!-- If your app opens https URLs -->
<intent>
<action android:name="android.intent.action.VIEW" />
<data android:scheme="https" />
</intent>
<intent>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="https" />
</intent>
</queries>
I was only having the VIEW one, not the one combined with BROWSABLE. however that did not seem to be necessary.
But what did the trick was the intent filter for my URL:
<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="mydomain.com" />
<data android:scheme="http" android:host="mydomain.com" />
</intent-filter>
I was only having the https
line since I will generate all my emails with the correct https urls. However adding the http scheme fixed it. Gmail now offers me to first choose my app!
Answered By - dirkvranckaert
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.