应用程序删除后的iOS App持久设置 [英] iOS App Persistent Settings After App Deleted

查看:131
本文介绍了应用程序删除后的iOS App持久设置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在创建一个应用程序,如下所示:

We are creating an app as follows:


  • 用户以2个免费令牌开头

  • 用户可以通过$ .99应用程序内购买一包10个代币

我们已经使用<$ c $实现了这个c> NSUserDefaults 以保存令牌数量。

We have implemented this using NSUserDefaults to save the number of tokens.

有没有办法让我们的免费2令牌设置持久?即使他们删除了应用程序?现在你可以删除应用程序并重新安装以再次获得2个令牌。 iOS 5有 NSUbiquitousKeyValueStore 用于将设置保存到iCloud,还有更好吗?

Is there a way to make our free 2 token setting persistent? Even if they delete the app? Right now you can delete the app and reinstall to get 2 tokens again. iOS 5 has NSUbiquitousKeyValueStore for saving settings to iCloud, is that any better?

如果不是,我们将不得不使用这个网络服务...

If not we will have to use a web service for this...

注意:此应用程序在MonoTouch中,但可能与问题无关。此外,在我们的应用程序中,用户无需重新安装应用程序以获得另外2个令牌(没有其他设置或游戏进度可能会丢失)。

NOTE: This app is in MonoTouch, but probably irrelevant to the question. Also, in our app, the user wouldn't care to reinstall the app to get 2 more tokens (there is no other settings or game progress they would lose).

推荐答案

只是我的2c,因为@Almo已经涵盖了大部分内容并应该获得积分: - )

Just my 2c as @Almo covers most of this already and should get the credits :-)

NSUbiquitousKeyValueStore 具有用户的优势,例如几个设备将共享相同的免费令牌。 OTOH可能不是你想要的应用程序...

NSUbiquitousKeyValueStore has the advantage of being by-user, e.g. several devices would share the same free tokens. OTOH that might not be something you want in your app...

卸载后离开数据会违反应用程序的沙盒。有办法做到这一点,比如你可以添加图片/照片/联系人/ ......,但不太可能被Apple批准,而且很容易被黑客攻击。

Leaving data after uninstallation goes against the sandboxing of applications. There are ways to do it, like you can add images/photos/contacts/..., but unlikely to be "Apple approved" and more than likely easy to hack around.

所以我也建议你使用网络服务。一种简单的方法是在没有找到应用程序数据(安装和重新安装)的情况下验证服务(例如,使用设备的MAC地址,因为设备唯一标识符正在消失),如果它是已知设备(无令牌) (获取令牌)。

So I also suggest you to use a web service. A simple way would be to validate with the service (e.g. using the device's MAC address since the device unique identifier is going away) when no application data is found (install and re-install) if it's a know device (no token) or not (get tokens).

如果付费令牌可重复使用(可以通过重新安装包含它们作为数据的备份来重新播放)那么您可能需要使用Web服务跟踪它们。不可重复使用的令牌不会受此影响(并且可能更容易处理)。

If the paid tokens are re-usable (could be re-played by re-installing a backup that includes them as data) then you might want to track them with the web service. Non-reusable tokens won't suffer from this (and are likely easier to deal with).

这篇关于应用程序删除后的iOS App持久设置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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