Can I get an unique and permanent device identifier on a Flutter app (iOS)? - ios

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).

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

Related

Is there any way to get a unique device ID in React Native for iOS?

I need to get a unique ID of a device that is always the same even when installing and uninstalling and reinstalling. Is there anything that is accessible anymore to accomodate this requirement?
Device name is now out the window with iOS 16 and it seems like serial number is not possible either. Is there something that can be unique to a device?
My app is not distributed through the app store either.
Thanks
You can use react-native-device-info, in that there are method called getDeviceToken() and getUniqueId() try to use that.
getUniqueId() gives you UUID of device.
https://www.npmjs.com/package/react-native-device-info#getdeviceid

How to identify iOS device uniquely instead of using UUID and UDID [duplicate]

This question already has answers here:
Unique Identification of iOS device for iOS 7.0 and above
(6 answers)
Closed 6 years ago.
In my iOS app, I have to restrict the user to use iOS app per device. To do this I found a solution that we can use the UUID (Universally Unique Identifier) or UDID (Unique Device Identifier). But according to this answer I can't use UUID, because if app gets deleted or reinstalled UUID has been getting changed and I don't want this. Also Apple rejects apps if app uses UDID.
Is there any way to identify iOS device uniquely.
Apple has done away with the approach of UDIDs and will reject apps that use the same for unique device identification.
Source: TNW
What you are looking for is Vendor ID
I'm using this library for my projects, and it's working like a charm, please try :
https://github.com/blackpixel/BPXLUUIDHandler
easy to use :
Import BPXLUUIDHandler.h
Retrieve the UUID with
[BPXLUUIDHandler UUID]
Thats all...
Here is some info from project's github page :
As of iOS 5, Apple has deprecated the device unique identifier api and
hasn’t provided a friendly Obj-C replacement, instead recommending
CFUUIDCreate and NSUserDefaults.
CFUUIDCreate isn’t very complicated and neither is NSUserDefaults, but
this solution fails in a few different ways:
It’s not a quick one-shot call to get the UUID; you have to write your own wrapper to make it friendly
It doesn’t persist; deleting the app blows away the UUID (can be persisted if stored in the keychain though)
There’s no way to share it between apps

Unique device identification for ios

I have a HTML/JS/CSS app which I wish to convert to an ios app using phonegap. In my application, I require to identify each device uniquely. From iOS 7 Apple does not accept app that Fetch UDID. I want to achieve this for ios4+ to latest. I have seen one plugin listed at https://build.phonegap.com/plugins/1112. One additional question related to this plugin is if I use a plugin which relies on keychain then what is the risk factor, i.e., under which circumstances is the keychain reset or cleared?
This is not common way but it may be helpful.
You can use service http://get.udid.io to get real UDID of device.
Here is repo with example of usage https://github.com/vladignatyev/udidio-example
Per swift, the latest way I've been doing this is:
var vendorDeviceId = UIDevice.currentDevice().identifierForVendor.UUIDString
This is correct, the UUID is now unique per app install, not device. If the user re-installs your app he will be assigned a new unique identifier (different from the last one).
According to Cordova documentation here's the way to get device UUID
var string = device.uuid;
Note that for iOS the UUID for a device is different from each app. This UUID is created on your app first run, and changes when you delete and re-install your app.
iOS Quirk
The uuid on iOS uses the identifierForVendor property. It is unique to the device across the same vendor, but will be different for different vendors and will change if all apps from the vendor are deleted and then reinstalled. The UUID will be the same if app is restored from a backup or iCloud as it is saved in preferences. Users using older versions of this plugin will still receive the same previous UUID generated by another means as it will be retrieved from preferences.
You can use my indentifier for vendor plugin
https://github.com/jcesarmobile/IDFVPlugin
It uses the native identifier for vendor https://developer.apple.com/library/ios/documentation/uikit/reference/UIDevice_Class/Reference/UIDevice.html#//apple_ref/occ/instp/UIDevice/identifierForVendor

iOS 8 Unique Identifier (Serial Number preferred)

I am working on an enterprise app and need access to programmatically retrieve the device's serial number. Is there an API or any documentation on how to retrieve this in iOS 8? From what I can tell, this functionality has been removed in iOS 8.
Is there a suitable replacement identifier for the serial? I need something that is reliable and will never change even if the device is reset.
It will be for enterprise usage so App Store approval is not a concern.
You're up a creek here. The two "tracking" features are Advertising Identifier and Identifier for Vendor. The former can be reset within the Settings app quite easily while the latter will reset once the user uninstalls all apps with the root bundle identifier associated with the app suite. Both also change with a device reset of course.
If you're deploying the app with an MDM solution you will have access to that device's UDID as it still flows forward to MDM servers, you just can't access it programmatically in your code. The complete deprecation of UDID, serial number and MAC address (even with private APIs) stomped all over some custom utilities I wrote within our Enterprise to try and accomplish something similar to what you're looking to do. If you find somethingthats consistent I'd love to see the follow-up!
EDIT:
I had an epiphany while circling back to this situation again. If you are in fact using AirWatch (I can't speak to Mobile Iron, etc) you can setup the console to send a keychain value to each device at the time of app install. From there the app will be able to consume the value AirWatch sends down. The same goes for any attribute that AirWatch harvests for the device (serial, UDID, MAC, etc). While this workaround comes with a big caveat (using AirWatch for deployment) it will work. Since Apple neutered all Serial Number work arounds win iOS8 this is the most viable option I have found.

Retrieving UDID via private API

I'm looking for a way to retrieve the UDID on devices running iOS 6+ (Enterprise deployment only - no app store limitations).
Calling the (now private) method uniqueIdentifier returns the 'vendorIdentifier' starting with 'FFFFFFF'. Unfortunately thats not what I want.
Any ideas? Is there another private method or something?
Thanks in advance.
I recommend you reading this article. To sum up:
The previously deprecated uniqueIdentifier now works like vendorIdentifier on iOS 7+, so it's no longer usable even for Enterprise Apps
OpenUDID cannot be shared between Applications on iOS 7+ and now can change. It's still usable but no longer recommended.
The vendorIdentifier hasn't changed, but it's not recommended for Enterprise Apps because it can change when updating the App.
The new advertisingIdentifier API is the way to go for new Apps. It's the same for all Apps and should not change frequently, but the user can reset it in the settings page.
Edit: Website udid.io obtains the real Device UDID instead of the obfuscated one if you need it for anything outside your App. If you need the UDID from within the App, see my answer above.
You can get a Unique UDID via this method using private api. Follow this link
Look for the code in accepted answer.
Sorry, but Apple warned it would be deprecated and it has been. I've had the same headache myself.
I can't help you identify the device in the same way Apple do, but you can always generate an unique UUID on app launch and stash that away in KeyChain. It won't be perfect, but it will persist between installations and will be unique to the device. As far as I know, that's the current solution

Resources