Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get application installation time in iPhone

Is there any way to get application insatllation time in iPhone? I wanted to use this information as a unique identifier, can I use it for this purpose?

like image 581
Dee Avatar asked Mar 24 '23 20:03

Dee


1 Answers

There is no way to get the application installation time.. You can keep track of the first launch of your application within your application using NSUserDefault.

In application didFinishLaunchingWithOptions: you could do

NSDate *date =[[NSUserDefaults standardUserDefaults]objectForKey:@"FirstLaunchTime"];
if (date == nil) {
     // nil means your application running for the first time
    [[NSUserDefaults standardUserDefaults]setObject:[NSDate date] forKey:@"FirstLaunchTime"]; // set the current time
}
like image 88
Anil Varghese Avatar answered Apr 06 '23 23:04

Anil Varghese