本文整理匯總了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();
}