Solved: iOS Device UUID not unique when user uninstall and re-install the app | ionic/cordova 📱

iOS Quirk:-

The uuid on iOS is not unique to a device, but varies for each application, for each installation. It changes if you delete and re-install the app, and possibly also when you upgrade iOS, or even upgrade your app per version (apparent in iOS 5.1). The uuid is not a reliable value.

Installation:-

  • Install the Cordova and Ionic Native plugins:

    $ ionic cordova plugin add cordova-plugin-uniquedeviceid
    $ npm install --save @ionic-native/unique-device-id

  • Add this plugin to your app's module

Usage:-

import { UniqueDeviceID } from '@ionic-native/unique-device-id';

constructor(private uniqueDeviceID: UniqueDeviceID) { }

...

this.uniqueDeviceID.get()
  .then((uuid: any) => console.log(uuid))
  .catch((error: any) => console.log(error));

Source: https://ionicframework.com/docs/native/unique-device-id/

comments powered by Disqus