I need to check when my app launches if it was being updated, because i need to make a view that only appears when the app is firstly installed to appear again after being updated.
At the top right, tap the profile icon. Tap Manage apps & device. Apps with an update available are labeled "Update available."
Answer: A: Answer: A: In the App Store App, find the App in which you have interest - then tap on the Version History link from the relevant App page. Here you will find the release dates for each version.
iOS SettingsOpen the Settings app on your iOS device. Scroll down the settings list and locate your app. Tap on your app to select it. The App Settings Panel has multiple options including Location, Notifications, Shell Version, App Version, etc.
Even Apple and Microsoft don't force security updates. You can always opt out or restore an older version. If its a security or feature requirement, you can tell your users the update is necessary, or the app will not function. You can block their credentials until they update, but it will still be their choice.
You could save a value (e.g. the current app version number) to NSUserDefaults
and check it every time the user starts the app.
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { // ... NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; NSString *currentAppVersion = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleShortVersionString"]; NSString *previousVersion = [defaults objectForKey:@"appVersion"]; if (!previousVersion) { // first launch // ... [defaults setObject:currentAppVersion forKey:@"appVersion"]; [defaults synchronize]; } else if ([previousVersion isEqualToString:currentAppVersion]) { // same version } else { // other version // ... [defaults setObject:currentAppVersion forKey:@"appVersion"]; [defaults synchronize]; } return YES; }
The swift-2 version looks like this:
let defaults = NSUserDefaults.standardUserDefaults() let currentAppVersion = NSBundle.mainBundle().objectForInfoDictionaryKey("CFBundleShortVersionString") as! String let previousVersion = defaults.stringForKey("appVersion") if previousVersion == nil { // first launch defaults.setObject(currentAppVersion, forKey: "appVersion") defaults.synchronize() } else if previousVersion == currentAppVersion { // same version } else { // other version defaults.setObject(currentAppVersion, forKey: "appVersion") defaults.synchronize() }
The swift-3 version looks like this:
let defaults = UserDefaults.standard let currentAppVersion = Bundle.main.object(forInfoDictionaryKey: "CFBundleShortVersionString") as! String let previousVersion = defaults.string(forKey: "appVersion") if previousVersion == nil { // first launch defaults.set(currentAppVersion, forKey: "appVersion") defaults.synchronize() } else if previousVersion == currentAppVersion { // same version } else { // other version defaults.set(currentAppVersion, forKey: "appVersion") defaults.synchronize() }
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