I am looking for a way to get the device’s UUID from an iPad from both PhoneGap and native Objective-C environment. The problem is that PhoneGap gives me only a hashed version of the devices UUID. For example:
1) device.uuid = E0AB7C8C-EFEE-4EB1-9B8F-A543575390A0
2) [[UIDevice currentDevice] uniqueIdentifier] = 75579DE5-98C7-53B6-B2AD-7F348662CB5D
But as I need both values to be the same, I need one of following solutions
1) How to hash the [device uniqueIdentifier] exactly as PhoneGap does in Objective-C.
2) How to get the raw (not hashed) device’s UUID from PhoneGap (JavaScript).
Does someone know how to achieve this?
Thanks in advance!
Since PhoneGap is open-source, you could have looked at how it generates the UUID yourself.
Here is the method PhoneGap uses (copied from
1.7.0). I also reproduced the Apache License just in case I should be.