0

I'm new to Iphone developing. I have next problem:

I need to get unique id for every iPhone that runs my application.

I found this great project on github: https://github.com/gekitz/UIDevice-with-UniqueIdentifier-for-iOS-5 These functions return string of 32 characters which represents some hexadecimal value.

Does someone have an idea how could I get unsigned long long value (64bit integer value) from this string?

Thanks

3 Answers3

2

Please note that as for iOS 5, getting the device's UUID is deprecated by Apple and unless you're working on an in-house project, you should not do it. Apple apparently started rejecting apps doing it with no proper reason.

The best way to uniquely identify your users is by generating a GUID at startup. Please see this SO thread : UIDevice uniqueIdentifier Deprecated - What To Do Now?

Community
  • 1
  • 1
scalbatty
  • 778
  • 4
  • 12
1

You cannot fit 32 unicode characters (every one has 2 bytes, that is 64 bytes in total) into a long long which has only 8 bytes.

Sulthan
  • 128,090
  • 22
  • 218
  • 270
0

Luzal is right...getting the device's UDID is deprecated by Apple.

You also can use the OPEN UDID for uniquely identify your users..

downloads the classes from here- https://github.com/ylechelle/OpenUDID

import the class -

#import "OpenUDID.h"

and use below code to get OPEN UDID

NSString * uniqueStr = [OpenUDID value];
NSLog(@"%@",uniqueStr);
Naina Soni
  • 720
  • 5
  • 21