UniqueDeviceID
UniqueDeviceID copied to clipboard
UUID is changing after application update for Android and IOS
I'm getting many logs from our customers, where the UUID is changing for every customer who has updated the application to newer version.
This is happening mostly with Android 6.0+ and IOS 10.0+.
I'm currently using 1.3.2 version of this plugin.
I'm not very sure about that, whether it changes after application update or OS version update. But it happens, and we're seeing many customers with this issue. Any help would be appreciated.
Android ID is currently build by combination of three components:
- Secure.ANDROID_ID: according to the android docs, this is stable over the whole livetime of a device
- TelephonyManager.getDeviceId(): should be stable
- TelephonyManager.getSimSerialNumber): depends on the SIM urrently plugegd to the device --> unstable
Is there any reason why the latter two are used? If only Secure.ANDROID_ID (https://developer.android.com/reference/android/provider/Settings.Secure.html#ANDROID_ID) would be used, the results should be unique and stable I guess.
Another idea: Just use https://developer.android.com/reference/android/os/Build.html#SERIAL. Even the official ordova device plugin propagates this property (https://cordova.apache.org/docs/en/latest/reference/cordova-plugin-device/#deviceserial).
Only if neither Secure.ANDROID_ID nor Build.SERIAL are available, other source values should be used to build the id.
Hi @regnete , Thanks for your reply. One more thing that I noticed is, all the customers facing this issue either they have Nexus or Pixel with latest version of Android version e.g. 7.0+.
Can you please tell me how is IOS UUID is generated?
I'm not a comiter for this project. I just made some suggestions to improve the plugin.
The iOS UUID is generated in a far different way. I gues they generate random UUID on first access and store it in the iOS keychain which is device specific.
Okay @regnete , Thanks. It also seems like the ios UUID is app specific. Because I've multiple apps, and for each app, it returns different UUID.
If i remmeber correctly this is required by the itunes app store rules. you are not allowed to track the physical device.
@rooz121359 Unfortunately, NO. :(
@razam217 - 9 months latter - any development - did you find a better substitute on this plugin? Or perhaps a workaround?
@angel1st Sorry for late reply. Now Android and IOS ID is not changing. In IOS it only changes after device reset.
In Android it changes if:
- DeviceID is changed (which will be changed if apk signing certificate is changed, device is reset or different Android User Account is used)
- Sim is changed
We are now maintaining a fork of this repository https://github.com/wizpanda/cordova-plugin-unique-device-id2.