background

The advertisingIdentifier documentation sees this:

Important

In iOS 10.0 and later, the value of advertisingIdentifier is all zeroes when the user has limited ad tracking.
Copy the code

In other words, on iOS10, if the user turns on the restricted AD tracking, the idfa will be a string of 00000000-0000-0000-0000-000000000000

Use:

Framework dependencies:

  • CoreTelephony.framework

Import simulateIDfa. h and Simulateidfa. m files

Call the code where SimulateIDFA is needed:

NSString *simulateIDFA = [SimulateIDFA createSimulateIDFA];
Copy the code

The format of simulateIDFA is the same as that of IDFA

626363D0-90D4-06BF-C281-384E4E69D3E2
Copy the code

SimulateIDFA was compared with OpenIDFA

OpenIDFA is an open source library by Yann Lechelle. It is the replacement scheme of IDFA

Timeliness comparison

  • OpenIDFA

You get different values every day

  • SimulateIDFA

SimulateIDFA is divided into two parts. The first 16 bits will change when the system is upgraded, and some behaviors of the last 16 bits may change the value (such as restarting the phone, modifying the device name, and modifying the phone’s local language).