Reputation: 1477
I need to use an IDFA in my app (iOS8). I proceed like this to get the IDFA string:
- (NSString *)identifierForAdvertising
{
if([[ASIdentifierManager sharedManager] isAdvertisingTrackingEnabled])
{
NSUUID *IDFA = [[ASIdentifierManager sharedManager] advertisingIdentifier];
return [IDFA UUIDString];
}
return nil;
}
In this method, I check if the user as enable or not the IDFA tracking in this device settings. It works well. I noticed that the IDFA changed all the time if I switch on/off the IDFA tracking in my device settings.
BUT: Even if the IDFA is disabled (in iOS settings), I can get it by calling directly:
NSLog(@"==>IDFA %@", [[[ASIdentifierManager sharedManager] advertisingIdentifier] UUIDString]);
And it's still the same even if I restart my app. I don't understand why and how it works exactly.
Someone has an idea ? Thank you. Regards,
Upvotes: 1
Views: 1311
Reputation: 114836
The documentation for isAdvertisingTrackingEnabled
states -
Check the value of this property before performing any advertising tracking. If the value is NO, use the advertising identifier only for the following purposes: frequency capping, attribution, conversion events, estimating the number of unique users, advertising fraud detection, and debugging
So, you need to respect the value of this property as far as tracking goes, but you can use the advertising identifier for those other purposes even when tracking is disabled.
Upvotes: 4