android - How to link cordova app to app store? -
how can create link button in cordova app, redirecting app on ios/android/amazon app store depending on device.
i have tried following code, gets in ios if clause, doesn't redirect me, neither gives error:
if(window.cordova && window.device) { if (device.platform.touppercase() === 'ios') { window.open("https://itunes.apple.com/gb/[obfuscated]"); } else if (device.platform.touppercase() === 'android') { window.open("https://play.google.com/store/apps/details?id=[obfuscated]"); } else { window.open("https://www.amazon.co.uk/[obfuscated]"); } }
i figured out:
ios: itms-apps://itunes.apple.com/app/[appid] android: market://details?id=[apppackageid] amazon: amzn://apps/android?p=[apppackageid]
Comments
Post a Comment