I've been looking into this, but I seem to find only the reverse scenario where you want to launch an intent to view your application on the Play Store. I'm wondering if it's possible to accept an Intent for a URI such as (market://details?id=com.my.packagename
) only if the URI contains your application's package name.
The idea would be to have a link on the website that would either launch the app (if already installed) or fall back to launching the Play Store open to the application's download page (if not installed).
I've tried a few combinations of an intent-filter with a market
scheme and data of my.packagename
, and things like that, but the application doesn't show up as a receiver.
This is impossible, I think. If you make a custom scheme, e.g. my-scheme://
then your app must be installed already to handle that scheme. And the most important thing is the browsers (Chrome, default browser, Firefox…): what will they do with such custom scheme? For security, they would probably ignore it.
Beside, the scheme market://
is now deprecated (some related info), Google has switched back to normal HTTPS form:
https://play.google.com/store/apps/details?id=your.package.name