ios重新安装应用程序后恢复数据 [英] ios restore data after reinstalling app

查看:62
本文介绍了ios重新安装应用程序后恢复数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个应用程序,该应用程序提供了一个功能的测试期.首次启动应用几天后,用户将无法再使用此功能,除非他通过应用内购买购买.

I am developing an app, which offers a testing period for a feature. After a few days after starting the app for the first time, the user is not able to use this feature any more unless he buys it with an in app purchase.

我将应用程序第一次启动的时间存储在用户首选项中.在用户卸载并重新安装应用程序后,恢复这些信息会很好.

I store the first time the app was started in the user preferences. It would be nice to restore this information, after user de-installs and reinstalls the app.

-> 从 iPhone 上删除应用程序后是否可以恢复内部应用程序数据?

-> Is there anyway to restore internal app data after deleting the app from an iPhone?

推荐答案

您需要为此使用钥匙串.钥匙串数据将在应用程序删除后保留并重新安装.这样您的时间戳就不会丢失,并且可以防止用户通过重新安装应用程序来作弊".

You need to use the keychain for this. Keychain data will survive an app deletion and reinstall. This way your timestamp won't be lost and will prevent users from "cheating" by reinstalling the app.

从 GenericKeychain 示例应用中获取 KeychainItemWrapper 类.这使得使用钥匙串变得更加容易.

Grab the KeychainItemWrapper class from the GenericKeychain sample app. This makes working with the keychain a lot easier.

这篇关于ios重新安装应用程序后恢复数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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