Need help upgrading to Ionic Framework 4.0? Get assistance with our Enterprise Migration Services EXPLORE NOW

App Version

Improve this doc

Reads the version of your app from the target build settings.

Requires Cordova plugin: cordova-plugin-app-version. For more info, please see the Cordova App Version docs.

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

Installation

  1. Install the Cordova and Ionic Native plugins:
    $ ionic cordova plugin add cordova-plugin-app-version
    $ npm install --save @ionic-native/[email protected]
    
  2. Add this plugin to your app's module

Supported platforms

Usage

import { AppVersion } from '@ionic-native/app-version';

constructor(private appVersion: AppVersion) { }

...


this.appVersion.getAppName();
this.appVersion.getPackageName();
this.appVersion.getVersionCode();
this.appVersion.getVersionNumber();

Instance Members

getAppName()

Returns the name of the app, e.g.: “My Awesome App”

Returns: Promise<string>

getPackageName()

Returns the package name of the app, e.g.: “com.example.myawesomeapp”

Returns: Promise<string>

getVersionCode()

Returns the build identifier of the app. In iOS a string with the build version like “1.6095” In Android a number generated from the version string, like 10203 for version “1.2.3”

Returns: Promise<string | number>

getVersionNumber()

Returns the version of the app, e.g.: “1.2.3”

Returns: Promise<string>

API

Native

General