Saturday - Yep! I worked even if it’s Saturday today, and I did work too even if I came home already. Well, I’m just giving back the favour the company gave me before ;)
So let’s get straight to what I’ve learned today. I have learned to get the Version and Build number of your project. i’ve spent like 30 mins or 1 hour to search for this! Haha Kidding. Just 30 mins, I guess. So below are the codes:
VERSION
[[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleShortVersionString"];
BUILD NUMBER:
[[[NSBundle mainBundle] infoDictionary] objectForKey:(NSString *)kCFBundleVersionKey];
Of course, it’s no brainer how to use that line of codes. That will return you a string, use it wherever you want to. You can print an NSLog or display that in a label. I have also here the complete codes how to get the complete details of your project. It includes the Version Number, Build Number, and the Bundle Name (or the bundle id).
NSDictionary *infoDictionary = [[NSBundle mainBundle]infoDictionary]; NSString *version = infoDictionary[@"CFBundleShortVersionString"]; NSString *build = infoDictionary[(NSString*)kCFBundleVersionKey]; NSString *bundleName = infoDictionary[(NSString *)kCFBundleNameKey];
One more thing, check this out, this is my tutorial for sending an email from your iPhone App. You can definitely use this tutorial for your SUPPORT page or screen of your app.
MAKE A SUPPORT OR CONTACT SCREEN FOR YOUR iOS APP.
iOS REFERENCE - HOW TO GET DEVICE TYPE AND iOS VERSION OF USER
Post a Comment