Unique Identification of iOS device for iOS 7.0 and above
Since iOS 7 it is no longer possible to get any unique device identifiers.
Your options are:
- create your own unique ID and save it in the keychain.
- use the vendor ID, which will be reset if all the app by the same vendor are removed from the device.
iOS7 - Device unique identifier
3) Any other suggestions...
You should consider strategies for identifying and authorizing the user instead of the device. Depending on a device-specific identifier prevents authorized users from switching devices without some sort of administrator interaction, and allows non-authorized users access if they happen to find/steal/borrow an authorized device. You can avoid these problems by relying on user credentials instead of device identifiers.
iOS 7 showing different UDIDs in different applications
You can't.
identifierForVendor
will only give you the same identifier for apps from the same developer on that device. And it's not guaranteed to be permanent; if you delete all the apps from the vendor, and then reinstall them, it's likely you'll get a different identifier.
As for your iOS6 implementation, that's not going to give you anything permanent, as the point of a UUID is to give you a unique string every time.
How can you uniquely identify an iOS device?
The closest thing we have to the uuid is the vendor id now
objective C iOS Device ID in iOS7
iOS does not allow you to identify a device universally anymore. That is the basic idea behind removing access to UDID and Mac address.
You need to change the design of your application to adapt to these new circumstances.
How to get unchanged device id from ios7 device programmatically
I have solved this by using advertisingIdentifier.
As I have seen there that advertisingIdentifier is
"An alphanumeric string unique to each device, ..."
For that I have used it as the unique identifier (though it is used for the
serving advertisements).
My code is:
-(NSString*)UniqueAppId
{
NSString *Appname = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleName"];
NSString *strApplicationUUID = [SSKeychain passwordForService:Appname account:@"manab"];
if (strApplicationUUID == nil)
{
strApplicationUUID = [[[ASIdentifierManager sharedManager] advertisingIdentifier] UUIDString];
[SSKeychain setPassword:strApplicationUUID forService:Appname account:@"manab"];
}
return strApplicationUUID;
}
and just calling it when needed as
[self UniqueAppId];
Related Topics
Uibutton with Single Press and Long Press Events Swift
How to Control Avassetwriter to Write at the Correct Fps
Apple MACh-O Linker (Id) Warning:Building for MACosx, But Linking Against Dylib Built for iOS
iOS Unrecognized Selector Sent to Instance in Swift
Calling a Method at Specific Time Every Day
Convert Nsattributedstring into Data for Storage
Non-Nominal Type X Does Not Support Explicit Initialization
Add Buttons to Uipickerview - Swift 1.2
"Invalid Predicate: Nil Rhs" for Second Argument in Nspredicate Format
Pull Notification Locally on Jailbroken Device
Ios7 - Device Unique Identifier
Accessibility for iOS, Voiceover Read Order Issue
Uicontrolstate.Normal Is Unavailable