Phonegap Get Application Version return null
I want to get my version of the application and display it on the screen.
I added this plugin to mine config.xml
and then used PhoneGap 3.3 to generate files .ipa
and .apk
.
<gap:plugin name="net.bgta.phonegap.plugin.appversion" version="1.1.1" />
Then inside onDeviceReady
I added this code to get AppVersion
:
getAppVersion(function (version) {
alert('Native App Version: ' + version);
});
But "version" always returns as null
. Did I miss something?
There is an issue on GitHub . A workaround is suggested here :
In Xcode, go to Build Phases . Open the Compiled Sources drop-down list . Click + and add the missing file
AppVersion.m
which should be in your Plugin Directory (but not in the compiled sources).