I want to create a promotional link for my app - which i can distribute via email. When the user clicks on the link from the email, a webpage does this:
- Determines which OS (iOS or Android)
- If app installed on device - opens the app
- Else - takes user to AppStore (or) PlayStore (or) a custom URL.
I tried using the AppLinks (applinks.org) - but I am unable to get it to work. How does the browser understand the "al:xx:xxx.." tags ? Does it only work for facebook/twitter?
<html>
<head>
<meta property="al:ios:url" content="applinks://docs" />
<meta property="al:ios:app_store_id" content="12345" />
<meta property="al:ios:app_name" content="App Links" />
<meta property="al:android:url" content="applinks://docs" />
<meta property="al:android:app_name" content="App Links" />
<meta property="al:android:package" content="org.applinks" />
<meta property="al:web:url" content="http://applinks.org/documentation" />
</head>
I also tried some javascript from another post - but if the app is not installed the browser shows an error:
<script>
window.onload = function() {
window.location = 'http://www.launchMyApp';
setTimeout("window.location = 'http://play.google.com/someApp';", 1000);
}
</script>
Please help with this. Thanks.