How to generate unique identifier which should work in all iOS versions?

前端 未结 3 694
南旧
南旧 2020-12-02 15:00

I want to get the unique identifier which should support all iOS versions..Can any one help me on this issue. As you know that apple is deprecated the UDID method, So there

3条回答
  •  误落风尘
    2020-12-02 15:44

    I don't have access to the code right now (can post in a few hours if you still need it) but what I've done is create a static method 'deviceIdentifier' in a helper class.

    the method does a basic check for the current iOS version, returns UDID if below 6.0 and uniqueIdentifier otherwise

    Let me know if you'd like the code for that and I'll post it when I can..it's only 10-15 lines or so if I remember right but makes a big difference as then you can just call '[myHelper deviceIdentifier]' wherever you need a device ID and not have to worry about which iOS version they are using

提交回复
热议问题