[Get Device Information] DeviceUUID is getting empty string

Forge Component
(0)
Published on 28 Feb by Viraj Kataria
0 votes
Published on 28 Feb by Viraj Kataria

Hello. The DeviceUUID is returning empty on my device.


Solution

Tiago Reis wrote:

Hello. The DeviceUUID is returning empty on my device.


Can you mention the Device manufacture & Platform, so that we can check.
But overall it's an JS API:


You can refer below JS to get the Device Information as an alternative to the component:

if (cordova) {

    $public.Device.whenReady().then(function() {     $parameters.DeviceModel = device.model;     $parameters.Platform = device.platform;     $parameters.UUID = device.uuid;     $parameters.Version = device.version;     $parameters.Manufacturer = device.manufacturer;     $parameters.IsSimulator = device.isVirtual;     $parameters.SerialNumber = device.serial;     $resolve();     }); } else {   // fallback when testing on desktop browser   $resolve(); }


- Create a JS Action & return Output params like this:

Solution

The second time I run it worked. I don't know what happened but now its working.

Happy to know it worked,

May be you added the component & you might be testing the same on OLD build.

Remember in-case you use any component, you should generate a new build & install it again on device.