I'm trying to create a link that can be sent via email which when opened my app on an android device. And if the app isn't on the device, it will go to the Google store and search for the app
You can do this:
Create a filter in your Manifest to handle certain URLS, for example:
<intent-filter>
<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="your-domain.com" android:path="/your-app"/>
</intent-filter>
So if user has your app installed and opens http://your-domain.com/your-app, your app will be opened and be able to handle it.
Then, make http://your-domain.com/your-app redirect to Google Play (https://play.google.com/store/apps/details?id=com.your.app) if opened directly without your app.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With