UniqueDeviceID icon indicating copy to clipboard operation
UniqueDeviceID copied to clipboard

UUID is changing after application update for Android and IOS

Open razam217 opened this issue 7 years ago • 10 comments

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.

razam217 avatar Mar 09 '17 07:03 razam217

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.

razam217 avatar Mar 12 '17 17:03 razam217

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.

regnete avatar Mar 13 '17 10:03 regnete

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?

razam217 avatar Mar 13 '17 12:03 razam217

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.

regnete avatar Mar 13 '17 13:03 regnete

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.

razam217 avatar Mar 13 '17 13:03 razam217

If i remmeber correctly this is required by the itunes app store rules. you are not allowed to track the physical device.

regnete avatar Mar 13 '17 14:03 regnete

@rooz121359 Unfortunately, NO. :(

razam217 avatar Jan 05 '18 10:01 razam217

@razam217 - 9 months latter - any development - did you find a better substitute on this plugin? Or perhaps a workaround?

angel1st avatar Jul 25 '18 10:07 angel1st

@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

razam217 avatar Sep 12 '18 08:09 razam217

We are now maintaining a fork of this repository https://github.com/wizpanda/cordova-plugin-unique-device-id2.

sagrawal31 avatar May 21 '19 08:05 sagrawal31