Is it possible to check when user downloaded my ios app? [duplicate]

浪子不回头ぞ 提交于 2019-12-02 03:55:04

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!