开发者

iOS: how to find application installation date and update date programmatically

开发者 https://www.devze.com 2023-03-26 00:32 出处:网络
I am developing one application in that I want to find application installation date on my device and开发者_C百科 when update happen that date and time as programmatically.Not sure if you can find an

I am developing one application in that I want to find application installation date on my device and开发者_C百科 when update happen that date and time as programmatically.


Not sure if you can find an application installation date but you could save the current date when the application is first ran. Something like this should do the trick

NSUserDefaults *prefs = [NSUserDefaults standardUserDefaults];
if (![prefs objectForKey:@"installation_date"]) {
        NSDate *now = [NSDate date];
        [prefs setObject:now forKey:@"installation_date"];
}

(This code is untested)

0

精彩评论

暂无评论...
验证码 换一张
取 消