Learn the powerful enterprise adaptable database:

Getting Started With ADABAS & Natural

Wednesday, July 12, 2017

203 IonicV1 Creator Ionic Native App Version


.
203 IonicV1 Creator Ionic Native App Version
Reads the version of your app from the target build settings.
cordova plugin add https://github.com/whiteoctober/cordova-plugin-app-version.git

IONIC CREATOR STEPS

1. Create a project.
3. Add Cordova Plugin.
cordova-plugin-app-version
4. Add codes to Controller.
function ($scope, $cordovaAppVersion) {


 document.addEventListener("deviceready", function () {
   var appVersion='';
   var appBuild ='';
   var appName ='';
   var appPackage ='';
   $cordovaAppVersion.getVersionNumber().then(function(version) {
       appVersion = version || '';
       $cordovaAppVersion.getVersionCode().then(function(build) {
           appBuild = build || 0;
           $cordovaAppVersion.getAppName().then(function(name) {
               appName = name || 0;
               $cordovaAppVersion.getPackageName().then(function(pckg) {
                   appPackage = pckg || 0;
                   alert("appversion:" + appVersion +
                       "\nappbuild:" + appBuild +
                       "\nappname:" + appName +
                       "\napppackage:" + appPackage
                   );

               });
           });
       });
   });
 
 }, false);/*device ready*/

}

REFERENCE


.

No comments:

Post a Comment