How to get package name / package id of an application in IONIC / Cordova (in JavaScript code)
I need to extract the package name / package ID of an application in an IONIC / Cordova application in my JavaScript code.
I've tried using type plugins $ionicPlatform
and $cordovaDevice
so far with no help.
+3
Sangwin gawande
source
to share
1 answer
After searching for hours, I couldn't find any plugins for this in IONIC.
In cordova there is one that has all the necessary properties.
cordova-plugin-buildinfo
Installation :
cordova plugin add cordova-plugin-buildinfo
Using:
document.addEventListener("deviceready", onDeviceReady, false);
function onDeviceReady() {
console.log('BuildInfo.packageName =' + BuildInfo.packageName);
console.log('BuildInfo.basePackageName=' + BuildInfo.basePackageName);
console.log('BuildInfo.displayName =' + BuildInfo.displayName);
console.log('BuildInfo.name =' + BuildInfo.name);
console.log('BuildInfo.version =' + BuildInfo.version);
console.log('BuildInfo.versionCode =' + BuildInfo.versionCode);
console.log('BuildInfo.debug =' + BuildInfo.debug);
console.log('BuildInfo.buildType =' + BuildInfo.buildType);
console.log('BuildInfo.flavor =' + BuildInfo.flavor);
}
+2
Sangwin gawande
source
to share