0

in our iOS app, we need to identify device uniquely for licensing purpose, but I found that Apple don't provides such kind of parameters to hold users privacy & security.

After my search I found UIDevice.current.identifierForVendor, it will generate unique id but the problem is, it will be different if app got uninstalled and reinstalled back.

Somebody in SO was suggesting that storing UIDevice.current.identifierForVendor in keychain might helps. But as per my understanding if same Apple ID is used in some other device, iCloud Keychain will sync into that device too, so we will loose the license.

Is there any solution we can try? Is it possible to disable syncing of only this item in keychain? please help me :)

kumara
  • 69
  • 6
  • 1
    You can have a look on [this](https://cocoapods.org/pods/FCUUID). – iPeter Feb 20 '19 at 09:25
  • I think it would be different on different devices – Shahzaib Qureshi Feb 20 '19 at 09:28
  • Possible duplicate of [Unique Identification of iOS device for iOS 7.0 and above](https://stackoverflow.com/questions/24753537/unique-identification-of-ios-device-for-ios-7-0-and-above) – user28434'mstep Feb 20 '19 at 09:36
  • I think this is a nice question. So why the downvote? What we currently do in our product is what you've discussed at the latter part of your question. This is fine for simple security measures such as banning of users. But for more extensive method and functionalities, iPeter suggested a good library, at least for me. – Glenn Posadas Feb 20 '19 at 09:37
  • 2
    @Glenn, because this type of question pops up almost every week. And it's always bad idea to link your app licensing to devices, instead of user accounts. Like, if user's device gets destroyed and he gets new one, they may lose ability to use the app they paid for, just because it's licensing hardwired to the device itself. – user28434'mstep Feb 20 '19 at 09:40
  • 2
    Have you considered using `Device Check` apple introduced it for iOS 11+ you can save a unique piece of information for a device using this API and apple will figure out how to uniquely identify the device internally so u don't have to worry. Will work perfectly for your need – Sandeep Bhandari Feb 20 '19 at 09:56
  • Hi [iPeteer](https://stackoverflow.com/users/4680556/ipeter), thanks for your solution, it fulfill my need. one question - is it possible to access keychain value which is created by library you suggested in Mac or iOS device? Everything is perfect but I'm worrying about what if user copies device identifier from one device to another? – kumara Feb 20 '19 at 15:01

0 Answers0