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

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

getDeviceUniqueId() {
.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 7) 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? i need this UniqueDeviceID for pushing notifications, and not uuid which provided in device library.

any suggestions please?

For push notifications you use a push token (or whatever it is called for the push library you are using) - not this kind of identifier.

@Sujan12 , Thanks for your response,
The push works correctly with my current code which is why I just want to solve the permission request issue.
Any ideas?

This is the way how Android works with this king of information. The user will be asked for this permission, unfortunately. What you can do is send a message modal informating that this permission is only to get device id. has nothing to do with Push - so if this plugin is causing unwanted permission popups, remove it and implement your push plugin properly.

@Sujan12 I think he wants the ‘device id’ to send or receive through push… The ‘push’ plugin is only part of code. The question is about the permission information to user, if can prevent it.

Yes. This device ID stuff is not necessary for that. Just use the functionality the push plugin provides.

If you want the uuid of a phone, you can get it with the Device plugin. No permission necessary ( I dont think ).

Like @Sujan12 mentions, it’s not relevant to push, but if you want it for some other reason Device is an / the option

Asks for “manage phone calls” permission. I have made app that gets ID of device, and this permission is required.

Ah. Sorry about that @DanielAccorsi.

Sir i have used uniqueDevice id plugin but it is not working proplery.issue is that the device token is not get every time.tell m sir why device token not getting properly?

Then open your own issue and include some code or description of what you are doing. With what you posted the only thing we can tell you: You are doing something wrong.

Ok sir i will post my code.