Hello, All, I have migrated my ionic/capacitor2 into capacitor3,
And I used Device plugin that provides in capacitor3,
I hope to get App Version from this plugin, but there is no option to get the app version,
or is there another plugin to get this?
Thanks and best regards
Is it in the getInfo method of the App plugin?
Use this plugin "@ionic-native /app-version/ngx"
import { AppVersion } from "@ionic-native/app-version/ngx";
constructor(private appVersion: AppVersion, private platform: Platform){}
class A {
if (this.platform.is('capacitor')) {
this.appVersion.getPackageName().then((res) => {
console.log(res)
})
this.appVersion.getAppName().then((res) => {
console.log(res)
})
if (this.platform.is("android")) {
this.appVersion.getVersionNumber().then((res) => {
console.log(res)
})
}
else if (this.platform.is("ios")) {
this.appVersion.getVersionNumber().then((res) => {
console.log(res)
});
}
}
}
2 Likes
App information has been moved from Device to App plugin, you can see it in the migration guide
Build iOS, Android, and Progressive Web Apps with HTML, CSS, and JavaScript
I got the app version from App plugin.
Thanks very much
1 Like