Can you explain me how to launch the Google Play app using the alert confirm button?
Here's the code:
let confirm = this.alertCtrl.create({
title: 'Nouvelle mise a jour disponible',
message: 'Version ameliorer de eLahiya disponible, voulez vous la telecharger?',
buttons: [
{
text: 'Plus tard',
handler: () => {
console.log('Disagree clicked');
}
},
{
text: 'Mise a jour',
handler: () => {
console.log('Agree clicked');
window.open("play.google.com/store/apps/details?id=<package_name>", '_system', 'location=yes')//
}
}
]
});
confirm.present();
I want my app to open my app's page on the playstore, how to do it?
this works perfectly for me:
window.open('market://details?id=your.package.name', '_system');
This is for Android though. For others:
IOS: itms-apps://itunes.apple.com/app/<appId>
Amazon: amzn://apps/android?p=<appPackageId>
Let me know if it works for you. Look into cordova-plugin-market as an alternative if that does not work.
Ionic native has a plugin to open an app's page in the market place. Here it is cordova-plugin-market
Use this command to install this plugin,
ionic plugin add cordova-plugin-market
npm install --save @ionic-native/market
Usage,
import { Market } from '@ionic-native/market';
constructor(private market: Market) { }
...
this.market.open('your.package.name');
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