1

I have the requirement to obtain a unique permanent identifier which allows me to identify an iOS device (iPhone) using a Flutter application.

I've understood that the IMEI is impossible to be used because Apple doesn't allow to retrieve it directly by code (post), I've thought about using the MAC address but how can I retrieve it by code?

I've read about the identifierForVendor but it changes if the app is uninstalled and then reinstalled so it is not permanent (and I cannot use it in my use case).

RiccardoB
  • 141
  • 15
  • Another approach is that you can create by your self an id (Guid or something like that) sending it by server side, saving it (if not exist) in device (sqlite db or somewhere persistent) that install your app. In this case you have control of id of that device. – G3nt_M3caj May 10 '22 at 12:18
  • 1
    The only identifier that will survive app reinstall is an identifier you place in the keychain. Even this will be lost if the device is erased. There is no way to get a permanent identifier for an iOS device that persists across erasure. This is by design – Paulw11 May 10 '22 at 12:48
  • So neither the MAC address ? – RiccardoB May 10 '22 at 12:52
  • No. Apple deliberately blocks access to identifiers, such as the MAC address, for privacy protection. – Paulw11 May 10 '22 at 19:39
  • Is it possible for you to use the DeviceCheck API? https://developer.apple.com/documentation/devicecheck/dcdevice. There's a flutter plugin for this: https://pub.dev/packages/device_check. It allows two bits of data to be uniquely associated with a device – Michael Horn May 11 '22 at 18:02

1 Answers1

1

Finally I've decided to use the "identifierForVendor" because it seems the more appropriate for the app context.

RiccardoB
  • 141
  • 15
  • identifierForVendor may change during update/re-install, you may want to store it in keychain, check the answer at https://stackoverflow.com/questions/38826130/the-udid-is-always-returning-zero-data-from-keychain-in-ios – Unreality Aug 19 '22 at 21:13