Ionic2 使用警报确认按钮打开Google Play

Ionic2 使用警报确认按钮打开Google Play,ionic2,google-play,alert,Ionic2,Google Play,Alert,你能解释一下如何使用警报确认按钮启动Google Play应用程序吗 代码如下: 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',

你能解释一下如何使用警报确认按钮启动Google Play应用程序吗

代码如下:

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();
let confirm=this.alertCtrl.create({
标题:“有争议的新事物”,
信息:“eLahiya可争议的版本,您有远程充电器吗?”,
按钮:[
{
文字:“加上皮重”,
处理程序:()=>{
console.log('discoverclicked');
}
},
{
文字:“每天一小时”,
处理程序:()=>{
console.log('agreeclicked');
window.open(“play.google.com/store/apps/details?id=“,”\u system”,“location=yes”)//
}
}
]
});
确认;

我想让我的应用程序在playstore上打开我的应用程序页面,怎么做?

Ionic native有一个插件可以在市场上打开应用程序页面。给你

使用此命令安装此插件

 ionic plugin add cordova-plugin-market
 npm install --save @ionic-native/market
用法

import { Market } from '@ionic-native/market';

constructor(private market: Market) { }

...

this.market.open('your.package.name');

这对我来说非常有效:

window.open('market://details?id=your.package.name', '_system');
不过这是针对Android的。对于其他人:

IOS: itms-apps://itunes.apple.com/app/<appId>
Amazon: amzn://apps/android?p=<appPackageId>
IOS:itms-apps://itunes.apple.com/app/ 如果这不起作用,作为替代方案