apache / cordova-plugin-device

Apache Cordova Device Plugin
https://cordova.apache.org/
Apache License 2.0
386 stars 429 forks source link

device.uuid=NULL on IOS 12.3.1 #103

Open sitehost opened 5 years ago

sitehost commented 5 years ago

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

janpio commented 5 years ago

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

sitehost commented 5 years ago

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

janpio commented 5 years ago

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.

sitehost commented 5 years ago

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

timbru31 commented 5 years ago

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

XieXiRong commented 5 years ago

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

jcesarmobile commented 5 years ago

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

cyptus commented 5 years ago

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

JoshuvaGeorge03 commented 5 years ago

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