如何检查应用程序安装的第一个日期? [英] How to check the first date an app is installed?

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

问题描述

我有一个付费应用,想在商店中免费提供几天.但只针对那些在这些特殊日子安装它的人,我想展示广告.

I have a paid app and want to offer it as free for a few days in the Store. But only for those who installed it during these special days I want to show ads.

如何检查用户是否在特定时间范围内安装了应用?

How can I check if a user installed the app in a specific time range?

我想到了这些解决方案:

  • 我可以在以前的包裹中签个名并在此签到包裹.如果它不可用,这是第一次安装.
  • 我可以在第一次安装后保存日期.

但这些现在不起作用.

谢谢.

推荐答案

您可以获取应用收据 从商店 (这里是它的样子)并解析您的产品的购买日期.但是,这将返回应用程序首次安装的日期,如果用户重新安装了应用程序,则它将返回第一次安装的日期(第一次从商店购买").

You can get App receipt from the store (here is how it can look like) and parse the PurchaseDate of your product. However this will return the date when the app has been first installed, if the user has reinstalled the app, then it will return the date of the very first installation (first 'purchase' from the store).

您还可以在 LocalSettings 中设置一个值,负责记住应用程序首次运行的日期.但这并不意味着安装日期 - 用户可以安装应用程序并在一个月后运行它.此外,当用户重新安装应用程序时,您将获得新值.

You can also have a value in LocalSettings that will be responsible for remembering the date of first run of the app. But this doesn't mean the date of installation - user can install the app and run it after a month. Also when user reinstalls the app, you will get the new value.

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

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