How To Get App Version Number In Ios
You can install this plugin by switching to your project directory with the terminal and running the following cordova command.
How to get app version number in ios. String versionname packageinfo version. Below that you ll see the size of the app itself and the size of the data stored by that app. Here is how you can get the current version number of the app.
All ios apps must store an app version number in their info plist file but there s no build in way to get that as a string you can use in your code. Nsbundle mainbundle infodictionary objectforkey cfbundleversion infodictionaryreturns a dictionary constructed from the bundle s info plist file that contains information about the receiver. Open the settings app on your iphone ipad or ipod touch.
Cordova plugin add cordova plugin app version after the installation you will be able to access the getappversion object in the cordova global object in the window. Fortunately we can write a small extension to uiapplication that reads the info plist file and returns a version number automatically. On your ipod ipod classic ipod nano or ipod mini press the menu button multiple times until the main menu appears.
Select general iphone storage. This object exposes the methods of the plugin. This might not exist for some reason so we re going to make a static variable that returns an optional string in case there was a problem reading it.
Build the app and display the version number note. On an iphone ipad or ipod touch to find software version installed on your device go to settings general then tap about. String versioncode packageinfo buildnumber.
It is also the version number that appears when the user looks at your app in the app store. In your code you can get the app version name and code like this. Next to the app icon you ll see the app name the version number you re looking for.