This guide shows you how to enable and disable advertising tracking.
Starting with iOS 14, you will need to set
AdvertiserTrackingEnabled and log each time you give a device permission to share data with Facebook.
Use the Advertiser Tracking Enabled parameter to indicate whether we should use event data for ads in line with your own legal obligations, platform terms and commitments you’ve made to your users.
AdvertiserTrackingEnabledis only available for iOS 14+.
If a device provides consent, call the
setAdvertiserTrackingEnabled method of the
FBSDKSettings class and set it to
YES for Objective-C or
true for Swift. If a device does not allow tracking, set
NO for Objective-C or
false for Swift. The method will return a boolean value to indicate whether the method is set successfully or not.
// Set AdvertiserTrackingEnabled to YES if a device provides consent [FBSDKSettings setAdvertiserTrackingEnabled:YES];
// Set AdvertiserTrackingEnabled to NO if a device does not provide consent [FBSDKSettings setAdvertiserTrackingEnabled:NO];
After a user assents to advertiser tracking and you enable events, be sure to initialize the SDK before sending events.