Replacing UDID in iOS7

Is there an alternative for UDID. My application will not be on the App Store, as I use corporate distribution. So there is a replacement. I bound the advertising identifier, opened udid, UIID and protected UDID. But if the phone is reset, then I will get a new UDID. Any help would be greatly appreciated.

+14
ios ios7 udid
Sep 18 '13 at 9:29
source share
7 answers

Try all possible replacements. Advertising id is the best way to go. It remains the same even after the phone is reset when I tested. If the user disables it in the settings, we will get a zero value. With the exception of this hitch, this is the best replacement so far. Will be updated if I find any other better replacement.

+3
Apr 12 '14 at 5:14
source share

For above 6.0 iOS you can use identifierForVendor Or CFUUIDRef .

 -(NSString*)uniqID { NSString* uniqueIdentifier = nil; if( [UIDevice instancesRespondToSelector:@selector(identifierForVendor)] ) { // iOS 6+ uniqueIdentifier = [[[UIDevice currentDevice] identifierForVendor] UUIDString]; } else { // before iOS 6, so just generate an identifier and store it uniqueIdentifier = [[NSUserDefaults standardUserDefaults] objectForKey:@"identifierForVendor"]; if( !uniqueIdentifier ) { CFUUIDRef uuid = CFUUIDCreate(NULL); uniqueIdentifier = ( NSString*)CFUUIDCreateString(NULL, uuid); CFRelease(uuid); [[NSUserDefaults standardUserDefaults] setObject:uniqueIdentifier forKey:@"identifierForVendor"]; } } return uniqueIdentifier; }// 

UPDATE

Like Leon Lucardie comment, he's right

identifierForVendor will change after uninstalling / reinstalling the application. See Here. The value in this property remains unchanged while the application (or another application from the same provider) is installed on the iOS device. The value changes when the user uninstalls all applications of these providers from the device and then reinstalls one or more of them.

+16
Sep 18 '13 at 9:33 on
source share

You need to create a vendor identifier and then save it using keychain and return it as soon as you reset using your phone using a time date

check this link UUID and UDID for iOS7

+3
Oct 11 '13 at 6:11
source share

Simple, just use this code:

 -(NSString *)getUID{ if ([[UIDevice currentDevice] respondsToSelector:@selector(identifierForVendor)]) { // This is will run if it is iOS6 and above return [[[UIDevice currentDevice] identifierForVendor] UUIDString]; } else { // This is will run before iOS6 and you can use openUDID or other // method to generate an identifier return [OpenUDID value]; } } 

As you can understand, if you plan to support iOS 5, then you should use OpenUDID (Apple restricts reading UDIDs even on iOS 5). With some answers here, you just get a waiver from Apple (my code has been approved in several of my apps).

Please note that the ForVendor identifier will change if your user uninstalls the application (or all provider applications, if there are several) and reinstalls it.

+1
Sep 19 '13 at 0:18
source share

I use a combination token APNS and vendorId. Both are checked to verify the identity of the cell phone, and I update them accordingly on the mobile phone and on the server when one of them changes.

It is still possible that both changes, when the application is deleted and / or reset and saved for several months, both values ​​will be changed.

This will cause the next time the cell phone installs the application, it will be identified as new.

In addition to this, I run a process on the server that marks as remote any device that has not been connected to the server for two months.

In this case, user authentication is required, and the mobile phone is again added to the client pool.

I have only one application yet, but as soon as I have a second, I could enable ads.

+1
Aug 20 '14 at 16:45
source share
0
Sep 18 '13 at 9:40
source share

You can use after ios 6+ with version Swift 2.2.

 var uniqueIdentifier: NSString! uniqueIdentifier = UIDevice.currentDevice().identifierForVendor?.UUIDString 
0
Jun 07 '16 at 11:56 on
source share



All Articles