本文整理汇总了TypeScript中@ionic-native/app-version.AppVersion类的典型用法代码示例。如果您正苦于以下问题:TypeScript AppVersion类的具体用法?TypeScript AppVersion怎么用?TypeScript AppVersion使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了AppVersion类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: constructor
constructor(private navCtrl: NavController, private navParams: NavParams, private alertCtrl: AlertController, private viewCtrl: ViewController, private storage: Storage, private events: Events, private appVersion: AppVersion, private barcodeScanner: BarcodeScanner, private userService: UserService, private utilService: UtilService) {
this.user = {
loginname: '',
avatar_url: '',
accesstoken: ''
}
this.appVersion.getVersionNumber().then((data) => {
this.versionNumber = data
}).catch((error) => {
console.log(error);
this.versionNumber = '请在手机中运行';
});
}
示例2: constructor
constructor(private navCtrl: NavController, private navParams: NavParams, private events: Events, private appVersion: AppVersion, private badge: Badge, private storage: Storage, private userService: UserService, private utilService: UtilService, private messageService: MessageService) {
this.user = {
avatar_url: '',
loginname: '',
score: '',
create_at: '',
};
events.subscribe('messageCount', (data) => {
this.messageCount = data;
});
this.versionNumber = '请在手机中运行';
this.appVersion.getVersionNumber().then((data) => {
this.versionNumber = data
}).catch((error) => console.log(error));
}
示例3:
this.platform.ready().then(() => {
if(this.platform.is('cordova')) {
this.av.getAppName().then((name) => {
this.appName = name;
});
this.av.getVersionNumber().then((version) => {
this.appVersion = version;
});
this.appRate.preferences.storeAppURL = {
ios: '1186113597',
android: 'market://details?id=com.scripture-golf.ldsscripturegolf',
windows: 'ms-windows-store://pdp/?ProductId=9wzdncrdnjbc'
};
}
});
示例4: Promise
return new Promise((resolve) => {
this.appVersion.getVersionNumber().then((value: string) => {
resolve(value);
}).catch(err => {
this.warn('getVersionNumber:' + err);
});
});
示例5: ionViewDidLoad
ionViewDidLoad() {
this.appVersion.getAppName().then(v => {
this.appName = v;
});
this.appVersion.getPackageName().then(v => {
this.packageName = v;
});
this.appVersion.getVersionCode().then(v => {
this.versionCode = v;
});
this.appVersion.getVersionNumber().then(v => {
this.versionNumber = v;
});
}
示例6: Promise
return new Promise(resolve => {
Promise.all([this.appVersion.getVersionNumber(), this.appVersion.getVersionCode()]).then(result => {
resolve(`${this.device.platform} ${this.device.version}<br>
${this.device.manufacturer} ${this.device.model}<br>
${window.screen.width * window.devicePixelRatio}x${window.screen.height * window.devicePixelRatio}<br>
Cordova ${this.device.cordova}<br>
Metho v${result[0]}(${result[1]})`);
}).catch(err => {
resolve(`${this.device.platform} ${this.device.version}<br>
${this.device.manufacturer} ${this.device.model}<br>
${window.screen.width * window.devicePixelRatio}x${window.screen.height * window.devicePixelRatio}<br>
Cordova ${this.device.cordova}`);
});
});
示例7:
.then(() => appVersionPlugin.getVersionNumber())
示例8: getVersion
getVersion(): any {
return this.appVersion.getVersionNumber();
}
示例9: ionViewDidLoad
async ionViewDidLoad() {
this.version = await this.appVersion.getVersionNumber();
}