如何确定第一次安装或使用应用程序的日期? [英] How to determine the date an app is installed or used for the first time?

查看:186
本文介绍了如何确定第一次安装或使用应用程序的日期?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我打算开设一个应用商店,我想免费为现有用户提供一些商品。

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 informaion the first time the app is used, then release the "real" update that'd look if the app was purchased before, however, it's likely that not everyone will opt for the first update.

那么,有没有办法找出用户首次安装的时间 (或使用过)应用程序?

So, is there a way to find out when exactly a user has first installed (or used) the app ?

更新:

谢谢你的答案,但我应该减少它的含糊不清:

Thanks for the answers, but I should make the it less ambiguous :

我正在寻找原生电话/类似的事情。由于该应用已经在商店,我还没有设置任何内容来存储第一个版本的数据,如果所有用户在第二次更新之前抓取它,更新将帮助我做我想要的已发布:无法区分新用户和错过中间更新的现有用户,并且刚刚更新到最新用户。

I'm looking for a native call/anything similar to do it. Since the app is already on store and I haven't set up anything to store the data on the first version, an update will help me do what I want if all the users grab it before the second update is released : It'd be impossible to distinguish a new user from an existing one who had missed the intermediary update and has just updated to the most recent one.

推荐答案

我的解决方案是检查应用包中其中一个文件的最后修改日期。

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];

这篇关于如何确定第一次安装或使用应用程序的日期?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆