IOS: Get the unchanging Udid

Source: Internet
Author: User

iOS: Get the history of unchanging Udidios unique identities 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

IOS: Get the unchanging Udid

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.