History of iOS unique logo iOS 6.0
Before iOS6.0, is the use of uniqueidentifier to obtain the phone's unique identity, and then Apple felt that this will reveal the user hidden, the closure of this method;
IOS 6.0 system has two new interfaces for replacing uniqueidentifier
- Identifierforvendor
- Advertisingidentifier
However, the Identifierforvendor will be uninstalled and then re-installed, it will change, so it cannot be used as the unique identity of the phone.
Later, to solve the problem, programmers thought of using WiFi MAC address as the unique identifier of the phone. Very happy to use the
But
IOS 7.0
IOS 7 Apple once again ruthlessly blocked MAC address, using the previous method to obtain the MAC address has all become 02:00:00:00:00:00
Smart handlers think of using ad identifiers as the only sign of a phone. But
As long as the user resets the ad identifier, they will still get a new ad ID. In this way, the advertising logo payment can not be used ....
What's the best way to do that?
The next step is to introduce a solution.
Use keychain to save the obtained unique identifier, so that even if the app is deleted and then loaded back, it can be read back from the keychain, and certainly not afraid to reset the ad identifier
Fcuuid
Search the Udid on GitHub and find the most stars in this stuff. Look at the Readme, add the test to your project, available
The device ID will still change when the iphone is completely erased. Seniors can only help here.
How to use
1. Click to download the required documents
Because Fcuuid needs to rely on another file from that author. So here are all the files put together for everyone to download and use.
Author Githun address Https://github.com/fabiocaccamo/FCUUID
2. Add Security.framework to the project
3. Import Header File
#import "FCUUID.h"
And then you can use it happily.
class methods provided by Fcuuid
// 每次运行应用都会变+(NSString *)uuid;//changes each time (no persistent), but allows to keep in memory more temporary uuids+(NSString *)uuidForKey:(id<NSCopying>)key;// 每次运行应用都会变+(NSString *)uuidForSession;// 重新安装的时候会变+(NSString *)uuidForInstallation;// 卸载后重装会变+(NSString *)uuidForVendor;// 抹掉iPhone的时候才会变,适合做唯一标识+(NSString *)uuidForDevice;
Personal test data
Paste_image.png
Wen/biharry (author of Jane's book)
Original link: http://www.jianshu.com/p/c7adc4e61e7b
Copyright belongs to the author, please contact the author to obtain authorization, and Mark "book author".
Get the invariant udid-b