Tuesday, April 24, 2018

203 IonicV1 Creator Ionic Native App Version

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.
2. Add ionic native to the 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 +
                       " appbuild:" + appBuild +
                       " appname:" + appName +
                       " apppackage:" + appPackage
                   );

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

}

REFERENCE

http://ngcordova.com/docs/plugins/appVersion/ 

https://github.com/whiteoctober/cordova-plugin-app-version 
.

visit link download

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.