2017-04-06 1 views
0

アラート確認ボタンを使用してGoogle Playアプリを起動する方法を教えてください。ここでアラート確認ボタンを使用して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(); 

私は私のアプリはそれを行う方法、playstoreに私のアプリのページを開くようにしたいですか?

答えて

2

、このプラグインをインストールするにはcordova-plugin-market

このコマンドを使用している:

window.open('market://details?id=your.package.name', '_system'); 

これは、Androidかかわらのためであります。その他の場合:

IOS: itms-apps://itunes.apple.com/app/<appId> 
Amazon: amzn://apps/android?p=<appPackageId> 

あなたのために働くかどうか教えてください。それがうまくいかない場合は、cordova-plugin-marketを参照してください。

2

イオン性ネイティブには、市場でアプリのページを開くためのプラグインがあります。ここでは、これが私のために完璧に動作

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'); 
関連する問題