I want to log the app version number so when user sends feedback, it will be in the email.
How can I get the number?
Open the Settings app on your Android device. Open the "Applications" and/or "Application Manager" section. Tap on your app to select it. The App Settings Panel has multiple options including App Version, Notifications, and Location.
Open the Settings app on your iPhone, iPad, or iPod Touch. Select General > iPhone Storage. Wait a moment, and the screen will populate with storage stats for each of your installed apps. Tap the app you want to see the version number for.
Version code is a special integer value which works as an internal version number. It is not visible to end users. Android system uses this number to protect against application downgrades — it is not possible to install new application with version code lower than in currently installed application.
NSDictionary* infoDict = [[NSBundle mainBundle] infoDictionary];
NSString* versionNum = [infoDict objectForKey:@"CFBundleVersion"];
NSString *appName = [infoDict objectForKey:@"CFBundleDisplayName"];
NSString *text = [NSString stringWithFormat:@"%@ %@",appName,versionNum];
You can send both the appname and version number using this code.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With