将 iPhone 应用程序的投票限制在特定 iPhone 设备上
我正在开发一个 iPhone 客户端应用程序,它允许用户对各种服务进行评分。无需注册或登录。
要求是用户不能重复对服务进行评分(尽管可以更改其评分)。从目前的情况来看,该应用程序可以被删除、重新安装,用户可以再次投票。
我们考虑过使用设备 ID,但一位同事提到 Apple 建议不要这样做。如果我理解正确的话,万一手机被退回商店、重新发行,然后新用户下载了相同的应用程序。对我来说这似乎是一个非常边缘的情况,但我想可能会发生在企业内部。
有没有一种聪明的方法来限制投票到特定设备?也许使用钥匙扣?
任何指示都非常感激。
I am working on a client iPhone app which allows users to rate various services. There is no registration or login.
The requirement is that a user can not repeatedly rate a service(although can change their rating). As things currently stand the app could be deleted, re-installed and the user could vote again.
We considered using the device id, however a colleague mentioned that Apple recommend against this. If I understand correctly in case a phone was returned to store, re-issued, and the new user then downloaded the same app. Seems like a pretty edge case to me, but I guess could happen within an enterprise.
Is there a smart way to restrict voting to a particular device? Perhaps using the keychain?
Any pointers greatly appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
请务必注意 UDID 和 UUID 之间的区别。
UDID“唯一设备ID”是特定于硬件的。对于特定设备,它永远不会改变。因此,它已成为隐私问题,苹果正在阻止尝试使用它的应用程序。因此,Apple 生成了一个可选择退出的“设备 ID”哈希值,特别是用于广告用途。这个新的 ID 哈希称为 IFA,在 iOS 6.0+ 中可用。
UUID“通用唯一 ID”不是特定于硬件的。它是用于识别设备的哈希值;但不是特别绝对值。例如,PhoneGap根据设备属性生成UUID;这就是你执行 device.uuid 时得到的结果。如果您删除该应用程序并重新安装,您将获得一个新的 id 哈希值。 Apple 并未阻止 UUID。
我认为针对您的情况,最好的解决方案是使用 IFA,并使用 OpenUDID 作为 iOS 的备份。 6.0。
这是我们使用的代码。如果 IFA 不可用,请获取 OpenUDID。您必须安装 OpenUDID,请在此处了解更多信息,https://github.com/ylechelle/OpenUDID。
Its important to note the difference between a UDID and a UUID.
UDID "unique device id" is hardware specific. It never changes for a particular device. For this reason, it has become a privacy concern and Apple is blocking apps that try to use this. As a result, Apple has generated an opt-out-able "device id" hash, particularly for advertisement usage. This new ID hash is called IFA and is available in iOS 6.0+.
UUID "universally unique id" is not hardware specific. It is a hash used to identify a device; but not particularly an absolute value. For example, PhoneGap generates a UUID based on device properties; this is what you get when you do device.uuid. If you delete the app and reinstall, you will get a new id hash. UUID is not being blocked by Apple.
I think the best solution in your case would be to use the IFA, with OpenUDID as a backup for iOS < 6.0.
Here is the code we use. If IFA is not available, get OpenUDID. You must install OpenUDID, read more about that here, https://github.com/ylechelle/OpenUDID.