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

Popular posts from this blog

magento2 - Magento 2 admin grid add filter to collection -

Android volley - avoid multiple requests of the same kind to the server? -

Combining PHP Registration and Login into one class with multiple functions in one PHP file -