I have an application currently on the app store which I intend to submit an update for soon.
With this update I want to add code which will tell the app when it first runs application:didFinishLaunchingWithOptions
whether it is:
There is no code in the app currently in the app store to handle this.
The application uses a SQLite database, but for reasons I won't go into here I don't want to use a check for its existence as a solution to this problem.
As a side question, without storing the data manually, is there an SDK I can use to query when an app was installed onto a device? (Preferably iOS 3.0 compatible)
I have seen a similar question, but none of the answers apply to working with existing app store code.
Open the App Store. Tap your profile icon at the top of the screen. Scroll to see pending updates and release notes. Tap Update next to an app to update only that app, or tap Update All.
At the top right, tap the profile icon. Tap Manage apps & device. Apps with an update available are labeled "Update available." Tap Update.
Show activity on this post. iOS Safari has a feature that allows you to add a "smart" banner to your webpage that will link either to your app, if it is installed, or to the App Store. You do this by adding a meta tag to the page.
The following code may help to answer your side question about when an app was installed. I am unsure if the app bundle create date is the XCode build date or the download date as this is untested from app store.
NSString *bundleRoot = [[NSBundle mainBundle] bundlePath]; // e.g. /var/mobile/Applications/<GUID>/<AppName>.app
NSFileManager *manager = [NSFileManager defaultManager];
NSDictionary* attrs = [manager attributesOfItemAtPath:bundleRoot error:nil];
NSLog(@"Build or download Date/Time of first version to be installed: %@", [attrs fileCreationDate]);
NSLog(@"Date/Time of last install (unless bundle changed by code): %@", [attrs fileModificationDate]);
NSString *rootPath = [bundleRoot substringToIndex:[bundleRoot rangeOfString:@"/" options:NSBackwardsSearch].location]; // e.g /var/mobile/Applications/<GUID>
attrs = [manager attributesOfItemAtPath:rootPath error:nil];
NSLog(@"Date/Time first installed (or first reinstalled after deletion): %@", [attrs fileCreationDate]);
You could save a version number to NSUserDefaults
, and update it accordingly.
If that won't work, you may be able to release an intermediate version which introduces the versioning scheme.
If that's not an option, you may be able to check for traces of previous runs from files you create, or preferences which you set conditionally or lazily.
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