How to do it...

Take a look at the following instructions:

  1. Create a new MyAppVersion app using the blank template, as follows, and navigate to the MyAppVersion folder:
$ ionic start MyAppVersion blank $ cd MyAppVersion
  1. Install the app-version plugin:
$ ionic cordova plugin add cordova-plugin-app-version
$ npm install --save @ionic-native/app-version
  1. Edit ./config.xml by changing the version number, as follows:
<widget id="com.ionicframework.myappversion637242" version="0.0.123" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">

Note that your widget id might be different from the one mentioned here. You only need to change the version number. In this case, it is the 0.0.123 version.

  1. Create the services ...

Get Ionic Cookbook - Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.