且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

ios重新安装应用程序后恢复数据

更新时间:2023-02-02 21:10:18

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

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.