iOS7 - 设备唯一标识符 [英] iOS7 - Device unique identifier

查看:41
本文介绍了iOS7 - 设备唯一标识符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们的 iOS 应用是针对特定用户的.因此,我们使用设备唯一标识符来识别用户.这种方法在 iOS 6 之前都可以正常工作,因为我们每次都获得相同的价值.

Our iOS application is for specific users. So, we used device unique identifier for user identification. This approach works fine till iOS 6, because we are getting same value every time.

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

在 iOS 7 中,上述方法正在重新调整不同的值,我们在用户识别方面遇到了问题.iOS 7 apis 提供以下替代.

In iOS 7, above method is retuning different values and we are getting issues in user identification. iOS 7 apis provide following alternate.

NSUUID *oNSUUID = [[UIDevice currentDevice] identifierForVendor];
[strApplicationUUID setString:[oNSUUID UUIDString]];

我用identifierForVendor"替换了uniqueIdentifier",并创建了临时构建.在 iOS 7 和 iOS 6 设备上安装构建.到目前为止,在 iOS 7 中,我每次都得到相同的值,但是当我们删除和重新安装应用程序时,iOS 6 每次都会给出不同的值.

I replaced "uniqueIdentifier" with "identifierForVendor", and created Ad hoc build. Installed build on both iOS 7 and iOS 6 devices. In iOS 7, so far, i am getting same value every time, but iOS 6 gives different values every time, when we delete and reinstall app.

目前应用程序在 App Store 上不可用.所以我不确定这个 api 是如何用于 App Store 构建的.

Currently application is not available on App store. So i am not sure how this api works for App store build.

问题:1) 对于 appstore 应用程序,identifierForVendor"是否每次都为 iOS 7 返回相同的值?或者将来用户删除并重新安装应用程序时它可能会改变?2) iOS 7 apis 中的唯一标识符"是否还有其他替代方法,它为 iOS 6 和 7 返回相同的值?3)任何其他建议...

Questions: 1) For appstore app, is "identifierForVendor" return same value for iOS 7 every time? or it may change when user delete and reinstall app in future? 2) Is any other alternative available for "unique identifier" in iOS 7 apis, which return same values for both iOS 6 and 7? 3) Any other suggestions...

推荐答案

3) 任何其他建议...

3) Any other suggestions...

您应该考虑识别和授权用户而不是设备的策略.依赖于特定于设备的标识符可防止授权用户在没有某种管理员交互的情况下切换设备,并在非授权用户碰巧找到/窃取/借用授权设备时允许他们访问.您可以通过依赖用户凭据而不是设备标识符来避免这些问题.

You should consider strategies for identifying and authorizing the user instead of the device. Depending on a device-specific identifier prevents authorized users from switching devices without some sort of administrator interaction, and allows non-authorized users access if they happen to find/steal/borrow an authorized device. You can avoid these problems by relying on user credentials instead of device identifiers.

这篇关于iOS7 - 设备唯一标识符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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