ios restore data after reinstalling app

邮差的信 提交于 2019-12-11 10:47:20

问题


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.

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


回答1:


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.

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




回答2:


if you are using the webservices then you can retrive it using web services.else you can save it into the keychain access.




回答3:


UserDefaults get deleted when you remove an app from the phone. Maybe you can use the Parse Data. I always use a Parse

https://www.parse.com/products/data



来源:https://stackoverflow.com/questions/16386423/ios-restore-data-after-reinstalling-app

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!