How to determine the date an app is installed or used for the first time?

后端 未结 10 581
慢半拍i
慢半拍i 2020-12-03 01:40

I\'m planning on opening up an in app store and I\'d like to give existing users some of the items for free.

I thought of releasing an update which would store some

10条回答
  •  渐次进展
    2020-12-03 02:18

    My solution would be to check the last modified date of one of the files in the app bundle.

    NSString *sourceFile = [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@"Icon.png"];
    
    NSDate *lastModif = [[[NSFileManager defaultManager] attributesOfItemAtPath:sourceFile error:&err] objectForKey:NSFileModificationDate];
    

提交回复
热议问题