I'm trying to get the UUID on iPhone 4.x simulator, however device.uuid
stops my app from running. I've also tried DeviceInfo.uuid
but this returns undefined despite being able to see the uuid in the DeviceInfo object in the debugger console.
Any ideas what I开发者_StackOverflow should be using?
I'm using PhoneGap 1.0.0
Thanks!
I experienced the same problem, not just with device.uui
, but with other events. In my case the problem was that XCode 4 put a reference in the html file to phonegap.js
instead of phonegap.{ver}.js
.
Its important to note the difference between a UDID and a UUID.
UDID "unique device id" is hardware specific. It never changes for a particular device. For this reason, it has become a privacy concern and Apple is blocking apps that try to use this. As a result, Apple has generated an opt-out-able "device id" hash, particularly for advertisement usage. This new ID hash is called IFA and is available in iOS 6.0+.
UUID "universally unique id" is not hardware specific. It is a hash used to identify a device; but not particularly an absolute value. PhoneGap generates a UUID based on device properties; this is what you get when you do device.uuid. If you delete the app and reinstall, you will get a new id hash. UUID is not being blocked by Apple.
It is a vague idea but: I think you actually cannot get an UUID from the simulator?
It could be that the simulator does not offer the same underlying architecture as a real device does.
And because a UUID is UNIQUE abd considering the fact that there are thousands of people using the simulator with Xcode I highly doubt apple would ship a unique UUID with every simulator, too.
Have you tried using a actual device?
HTH
精彩评论