How to get UniqueDeviceID in Ionic 3 without need for a special permission?

1.8k views Asked by At

I am using the code provided in the documentation to get a unique identifier for the device:

getDeviceUniqueId() {
    this.uniqueDeviceID.get()
        .then((uuid: string) => this.uniqueDeviceIdStr = uuid)
        .catch((error: any) => {
            this.uniqueDeviceIdStr = "N/A";
            this.loggingService.logError("Error getting device unique identifier", error);
    });
}

However, when this code is executed the following message is displayed:

Allow to make and manage phone calls?

I am testing against an Android device (version 6.0.1) and my application does not require this permission for any other functionality. Removing the code also removes this permission requirement dialog.

The unique identifier is properly displayed if I grant the app the requested permission.

Question: How to get UniqueDeviceID in Ionic 3 without need for a special permission?

0

There are 0 answers