问题
Is it possible to check when the user downloaded my iOs app, and if so, is it possible to make a if statement out of it like:
if(downloadDate>1march) {
}
sorry if you think the question is bad... any code would be greately appreciated though :D
should also probably mention that my app has been on the AppStore for six months...
回答1:
I'm not sure if there's a way to automatically check a download date.
But you can certainly set a date for when the app was very first launched. In your appDidFinishLaunching method in your app delegate:
if (![[NSUserDefaults standardDefaults] objectForKey:@"FirstLaunch"]) {
[[NSUserDefaults standardDefaults] setObject:[NSDate date] forKey:@"FirstLaunch"];
}
Any point after this, you can check this date and compare it to whatever you want.
来源:https://stackoverflow.com/questions/22108302/is-it-possible-to-check-when-user-downloaded-my-ios-app