Other smart phones (Android, Blackberry) also has an id that uniquely identifies the device.
udid value can be easily taken from the class UIDevice by using this simple objective C line:
I am currently working on a mobile installation tracking process. In order to track installations you must compare between the udid of the device when the installed application is first launched.NSString* udid = [UIDevice currentDevice].uniqueIdentifier;
While conducting tests with udid, I noticed that iPhone udid structure is different when running on X-Code simulator comparing to running on a real device.
Where running on X-Code simulator the value contains the following pattern:
where "H" stands for Hex number. Note that if there are letters (A-F) they are capital.HHHHHHHH-HHHH-HHHH-HHHH-HHHHHHHHHHHH
For example:
When running on a real device the udid value is 40 hex chars. The letters are small. Note that there are no minus ("-") characters used.79550EDC-2A86-5BDF-8EE2-219B7FCBD223
For example:
I think that the udid is different in the simulator and on a real device because the simulator simply return the udid of the Mac machine and the Mac machine udid string is different than the iPhone device udid.ce43446816952ff4513e1389c5e1d3ac3a856141
No comments:
Post a Comment