cordova-plugin-device icon indicating copy to clipboard operation
cordova-plugin-device copied to clipboard

device.uuid=NULL on IOS 12.3.1

Open sitehost opened this issue 6 years ago • 9 comments

Problem

using device.uuid on IOS 12.3.1 returns all as NULL

'Device Name: ' + device.name + '
' + 'Device Cordova: ' + device.cordova + '
' + 'Device Platform: ' + device.platform + '
' + 'Device UUID: ' + device.uuid + '
' + 'Device Version: ' + device.version + '
';

What is expected to happen?

on IOS 12.2 device.uuid will display the correct uuid, however on IOS 12.3.1 they return NULL.

What does actually happen?

device.uuid returns a NULL

Information

working from a cordova build, it has worked on all of our devices until we did an update to 12.3.1 . What is the work around, or a solution to gather the IOS uuid

Command or Code

run device.uuid on 12.3.1 and on 12.2.1

Environment, Platform, Device

Version information

Checklist

  • [x ] I searched for existing GitHub issues
  • [ x] I updated all Cordova tooling to most recent version
  • [x ] I included all the necessary information above

sitehost avatar Jun 26 '19 02:06 sitehost

What would be the "correct uuid"? What is the iOS code necessary to get that?

janpio avatar Jun 26 '19 10:06 janpio

well its not giving any UUID from the device. it works on ios < 12.1 but on later updates its giving NULL

sitehost avatar Jun 28 '19 03:06 sitehost

Yes, I understood that. I am asking what is a UUID for the device under iOS 12.3 and what native code Apple provides to get it.

janpio avatar Jun 28 '19 07:06 janpio

It's a unique device Id. And I am not sure. I'm using this plugin. The code for this plugin to get it is device.uuid in javascript

sitehost avatar Jun 28 '19 08:06 sitehost

I can't reproduce this issue.

Is this reproducible in a new, plain Cordova app? A minimal reproduction repository would really help to debug and later fix this issue. More information on how to create one: https://github.com/apache/cordova-contribute/blob/master/create-reproduction.md

timbru31 avatar Jul 12 '19 10:07 timbru31

yes, it is a big problem. not work after ios 12.2

sorry it is my fault,actually the method is work in ios version 12.2 and 12.3

XieXiRong avatar Jul 13 '19 12:07 XieXiRong

I can't reproduce neither, even if trying to return NULL or nil from native makes the app crash instead of returning NULL, the only way of returning a null value is by returning [NSNull null], but that returns null, not NULL.

Anyway, looks like the identifierForVendor can return nil in rare cases, that could cause a crash as mentioned earlier

If the value is nil, wait and get the value again later. This happens, for example, after the device has been restarted but before the user has unlocked the device.

https://developer.apple.com/documentation/uikit/uidevice/1620059-identifierforvendor

jcesarmobile avatar Jul 19 '19 16:07 jcesarmobile

i got the same issue, plugin is not working anymore after ios 12.3.1

cyptus avatar Jul 24 '19 15:07 cyptus

And also device.serial return 'unknown' in ios 12.3.1.. Is any fix for these issue?

JoshuvaGeorge03 avatar Sep 18 '19 09:09 JoshuvaGeorge03