如何确定应用程序首次安装或使用的日期?

2023-10-03移动开发问题
0

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

问题描述

我计划开设一个应用商店,我想免费为现有用户提供一些项目.

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.

推荐答案

我的解决方案是检查 app bundle 中某个文件的最后修改日期.

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

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

The End

相关推荐

硬件音量按钮更改应用程序音量
Hardware Volume buttons change in app volume(硬件音量按钮更改应用程序音量)...
2024-08-12 移动开发问题
10

Cocos2d - 如何检查不同层中对象之间的交集
Cocos2d - How to check for Intersection between objects in different layers(Cocos2d - 如何检查不同层中对象之间的交集)...
2024-08-12 移动开发问题
8

突出显示朗读文本(在 iPhone 的故事书类型应用程序中)
Highlight Read-Along Text (in a storybook type app for iPhone)(突出显示朗读文本(在 iPhone 的故事书类型应用程序中))...
2024-08-12 移动开发问题
9

Cocos2D + 仅禁用 Retina iPad 图形
Cocos2D + Disabling only Retina iPad Graphics(Cocos2D + 仅禁用 Retina iPad 图形)...
2024-08-12 移动开发问题
10

正确的 cocos2d 场景重启?
Proper cocos2d scene restart?(正确的 cocos2d 场景重启?)...
2024-08-12 移动开发问题
7

[ios.cocos2d+box2d]如何禁用自动旋转?
[ios.cocos2d+box2d]how to disable auto-rotation?([ios.cocos2d+box2d]如何禁用自动旋转?)...
2024-08-12 移动开发问题
7