3

I have an app on the App Store, and I want to make some changes that will not effect users that previously downloaded my app.

Is there a way to determine if the user has previously downloaded my app?

poupou
  • 43,413
  • 6
  • 77
  • 174
DarthVadar123451
  • 619
  • 1
  • 6
  • 14

2 Answers2

3

Incase anyone is still wondering, a great solution to this problem (assuming you don't already have it) is using the Keychain, which persists through app installation/uninstalls. This library allows you to access the Keychain using NSDictionary-like syntax.

https://github.com/nicklockwood/FXKeychain

So you could implement a function like this:

-(BOOL)alreadyInstalled
{
NSString *installDate = [[FXKeychain defaultKeychain] objectForKey:@"InstallDate"];
if (!installDate)
{
    NSString *newInstallDate = [NSString stringWithFormat:@"%i", [[NSDate date] timeIntervalSince1970]];
    [[FXKeychain defaultKeychain] setObject:newInstallDate forKey:@"InstallDate"]
    return NO;
}
return YES;
}
Andrew Schreiber
  • 14,344
  • 6
  • 46
  • 53
2

I don't know a great way to do this but there are some tricks you can do, e.g.:

  1. Look for some data that your application generates. If the data already exists then it's not an update (or an update that completed previously);

  2. Prepare yourself for this, even if this means issuing an intermediate update to your application, then go back to #1. See: How to tell if an iOS application has been newly installed or updated?

Community
  • 1
  • 1
poupou
  • 43,413
  • 6
  • 77
  • 174