Currently I am developing an application which is supposed to be invoked when the user clicked on a predefined format of an url in any browsers on a web page. There are two choices of the format comes to my mind.
https://mobile.meta.com/payment/applink.html?page=login&payload=some_payload (app link with https scheme)
metaapp://payment?page=login&payload=some_payload (app link with custom scheme)
So I tried https scheme first. I was testing my app on chrome and everything works fine. My app get invoked directly without any problems.
So when I use
intent.getData()
in my native code, it returns the correct https request that invokes the app.
However, when I installed other browsers and test, something went wrong. My app get launched successfully but intent.getData() returns a custom url with all the query parameters lost (this is a custom url I defined in the app manifest already). It also appears that for most of the browser , the page get redirected to the play store page of the app. (that isn't happening in Chrome)
https://mobile.meta.com/payment/applink.html is a domain owned by the owner of the application I'm developing, I have no control over this website hence it's more preferable if I can solve this problem entirely in the android application side, when I entered this url into the browser, it redirects to the google play store page of this application.
So my first question is why are their behaviours different? Why isn't the application invoked by the browser directly like how Chrome is reacting but instead the page get redirected to the website first, then the app is invoked?
My second question is how to resolve this problem (without altering the website, i.e. doing all the work in the android app manifest maybe)?
Next, I tried the custom scheme and all the browsers behave in the same way, the app get invoked without any problems.
So my third question is why this time all the browsers behave in the same way?
My last question is why click the url https://mobile.meta.com/payment/applink.html can invoke the application with a custom scheme url? What is this site actually doing behind the scene so that it can actually open the google play store page plus calling the application?
PS I'm aware of the following related questions but it seems that they are telling there's no solution for this problem:
Open App from URL works on Firefox for Android but not on Google Chrome
Workaround for Chrome on Android not firing intent when links are clicked