0

I see any examples of this, but all of than use the "device ready", I really need to use this event or I can get the device uuid out of this event?

When I tested this on my browser I got the gap of device uuid, but on device this don't show me anything.

Anyone Can show me an example?

  • Possible duplicate of [How to get a device identifier using Phonegap](http://stackoverflow.com/questions/20359655/how-to-get-a-device-identifier-using-phonegap) – Evan Wieland May 17 '17 at 18:38

2 Answers2

2

Install the Device plugin as explained here: https://github.com/apache/cordova-plugin-device

Then in your Javascript call device.uuid.

camelCaseCoder
  • 1,447
  • 19
  • 32
2

There is this plugin cordova device which is able to get the device uuid. As always plugins can only be used after the device ready event was fired.

Example:

document.addEventListener("deviceready", onDeviceReady, false);
function onDeviceReady() {
    console.log(device.uuid);
}
Andre Kreienbring
  • 2,457
  • 11
  • 16