iPhone 永久数据存储

发布于 2024-08-23 04:57:02 字数 120 浏览 1 评论 0原文

如何在 iPhone 中存储信息,使其在应用程序删除时无法删除。例如,指示用户是否已使用所有试用功能。我尝试使用 [NSUserDefaults standardUserDefaults] - 但每次删除应用程序时它都会刷新。

How to store information in iPhone so that it cannot be removed when application removed. For example to indicate if user already used all trial features. I tried to use [NSUserDefaults standardUserDefaults] - but it refreshed each time app deleted.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

还在原地等你 2024-08-30 04:57:02

苹果不允许你这样做。如果应用程序在卸载后可能会留下文件,那么您的磁盘可能会被填满,而无法真正删除这些内容。

Apple doesn't allow you to do this. If Apps could leave files after they are uninstalled then you could have your disk fill up with no way to actually get rid of the stuff.

勿忘初心 2024-08-30 04:57:02

某些应用程序通过检索设备的唯一标识符 (UDID) 并将其存储在其服务器上来处理此问题。如果服务器在应用程序的验证步骤中两次看到相同的 UDID,则拒绝验证。

Some applications handle this by retrieving the device's unique identifier (UDID) and storing it one their servers. If the server sees the same UDID twice from the application's validation step, deny validation.

素衣风尘叹 2024-08-30 04:57:02

我认为可以将此类数据存储在钥匙串中,请参阅 此论坛。我也认为做这样的事情是邪恶的,因为你在与用户作斗争,但这是你的选择。

I think it’s possible to store such data in the keychain, see this forum. I also think it’s evil to do such a thing, as you are fighting the user, but it’s your choice.

望笑 2024-08-30 04:57:02

这里最好的选择可能是将数据存储到服务器,将设备 UDID 与您想要存储的任何信息相关联。要获取 UDID,请执行以下操作:

NSString *udid = [[UIDevice currentDevice] uniqueIdentifier];

如果您不想自己设置服务器,可以使用我一直在尝试的名为 Parse 的便捷服务: http://www.parse.com/ 您将能够使用他们的本机 SDK 将数据存储到他们的云服务中,然后检索它。您应该能够简单地将 udid 与其对象之一一起存储,然后通过查询再次检索它。

Your best bet here is probably to store data to a server, associating the device UDID with whatever information you want to store. To get the UDID, do this:

NSString *udid = [[UIDevice currentDevice] uniqueIdentifier];

If you don't want to setup a server yourself, you can use this handy service I've been trying out called Parse: http://www.parse.com/ You'll be able to use their native SDKs to store data to their cloud service, and then retrieve it. You should be able to simply store the udid with one of their objects, and then retrieve it again with a query.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文