Skip to content

Don't show 'isAdvertiserTrackingEnabled' deprecation warning below iOS 17 #2371

Open
@chwo

Description

@chwo

Checklist before submitting a bug report

  • I've updated to the latest released version of the SDK
    I've searched for existing GitHub issues
    I've looked for existing answers on Stack Overflow, the Facebook Developer Community Forum and the Facebook Developers Group
    I've read the Code of Conduct
    This issue is not security related and can safely be disclosed publicly on GitHub

Xcode version

15.3

Facebook iOS SDK version

17.0.0

Dependency Manager

CocoaPods

SDK Framework

Core

Goals

I want to use the sdk according to the documentation without getting a deprecation warning.

Expected results

According to the documentation, manually setting the isAdvertiserTrackingEnabled parameter is only necessary up to iOS 17:

For iOS 17.0 and later devices, you are no longer required to set the Advertiser Tracking Enabled parameter for Facebook SDK for iOS 17.0.0 and later versions. We now rely on Apple’s App Tracking Transparency (ATT) system API to determine ATT permission status for app events sent through Facebook SDK for iOS 17.0.0 and later versions.

So with a lower minimum deployment target (e.g. iOS 16) it is still necessary to manually set the parameter. E.g.

if #unavailable(iOS 17) {
    FBSDKCoreKit.Settings.shared.isAdvertiserTrackingEnabled = true
}

In that case there should be no deprecation warning because it is useless until one updates the minimum deployment target to iOS 17.

Actual results

After updating the sdk to version 17.0.0 and FBAudienceNetwork to version 6.15.0 this gives a deprecation warning (defined in FBAdSettings.h):

Setter for 'isAdvertiserTrackingEnabled' is deprecated: The setAdvertiserTrackingEnabled flag is not used for FBSDK v17+ on iOS 17+ as the FBSDK v17+ now relies on ATTrackingManager.trackingAuthorizationStatus.

/**
 User's consent for advertiser tracking.
 */
+ (void)setAdvertiserTrackingEnabled:(BOOL)advertiserTrackingEnabled
    NS_DEPRECATED_IOS(
        12_0,
        17_0,
        "The setter for advertiserTrackingEnabled flag is deprecated: The setAdvertiserTrackingEnabled flag is not used for Audience Network SDK 6.15.0+ on iOS 17+ as the Audience Network SDK 6.15.0+ on iOS 17+ now relies on [ATTrackingManager trackingAuthorizationStatus] to accurately represent ATT permission for users of your app");

Steps to reproduce

No response

Code samples & details

// INSERT YOUR CODE HERE
var example = "Example code"

Activity

sea7reen

sea7reen commented on Apr 7, 2024

@sea7reen

i have same issue

VladOrackle

VladOrackle commented on Apr 8, 2024

@VladOrackle

Same

Nass33m

Nass33m commented on Apr 9, 2024

@Nass33m

same

michalnowak061

michalnowak061 commented on Apr 12, 2024

@michalnowak061

up

YixingWangJ

YixingWangJ commented on Apr 16, 2024

@YixingWangJ

same

ezanalemma

ezanalemma commented on Apr 20, 2024

@ezanalemma

Same, please fix

UnuSynth

UnuSynth commented on Apr 23, 2024

@UnuSynth

Same

ionutivan

ionutivan commented on Apr 24, 2024

@ionutivan

Same

guillermomuntaner

guillermomuntaner commented on Apr 30, 2024

@guillermomuntaner

Is this really the case that the SDK would still need this flag for iOS < 17? Or is only about the v17 of the SDK?

From the code it looks as this if really for iOS 14+, and the issue here seems the miss-leading documentation:

private var _advertisingTrackingStatusFromATT: AdvertisingTrackingStatus {
var advertisingTrackingStatus: AdvertisingTrackingStatus = .unspecified
if #available(iOS 14.0, *) {
let status: ATTrackingManager.AuthorizationStatus = ATTrackingManager.trackingAuthorizationStatus
switch status {
case .authorized:
advertisingTrackingStatus = .allowed
case .denied, .restricted:
advertisingTrackingStatus = .disallowed
case .notDetermined:
advertisingTrackingStatus = .unspecified
@unknown default:
advertisingTrackingStatus = .unspecified
}
}
return advertisingTrackingStatus

daniel-l2

daniel-l2 commented on May 4, 2024

@daniel-l2

Is this really the case that the SDK would still need this flag for iOS < 17? Or is only about the v17 of the SDK?

From the code it looks as this if really for iOS 14+, and the issue here seems the miss-leading documentation:

private var _advertisingTrackingStatusFromATT: AdvertisingTrackingStatus {
var advertisingTrackingStatus: AdvertisingTrackingStatus = .unspecified
if #available(iOS 14.0, *) {
let status: ATTrackingManager.AuthorizationStatus = ATTrackingManager.trackingAuthorizationStatus
switch status {
case .authorized:
advertisingTrackingStatus = .allowed
case .denied, .restricted:
advertisingTrackingStatus = .disallowed
case .notDetermined:
advertisingTrackingStatus = .unspecified
@unknown default:
advertisingTrackingStatus = .unspecified
}
}
return advertisingTrackingStatus

Seems like SDK uses _advertisingTrackingStatusFromATT only when isDomainHandlingEnabled() returns true.

if _DomainHandler.sharedInstance().isDomainHandlingEnabled() {
return _advertisingTrackingStatusFromATT
} else if #available(iOS 14, *) {
return _advertisingTrackingStatus
} else {
return ASIdentifierManager.shared().isAdvertisingTrackingEnabled ? .allowed : .disallowed
}

And isDomainHandlingEnabled always returns true for iOS >= 17, but not for iOS < 17.

- (BOOL)isDomainHandlingEnabled
{
if (@available(iOS 17.0, *)) {
return YES;
}
NSDictionary *domainConfig = [self.domainConfigurationProvider cachedDomainConfiguration].domainInfo;
id enableForEarlierVersions = [[domainConfig objectForKey:kDefaultDomainConfigKey] objectForKey:kEnableForEarlierVersionsKey];
BOOL shouldEnableForEarlierVersions = enableForEarlierVersions ? [enableForEarlierVersions boolValue] : NO;
BOOL isIOS145Available = NO;
if (@available(iOS 14.5, *)) {
isIOS145Available = YES;
}
return (isIOS145Available && shouldEnableForEarlierVersions);
}

So it seems like the warning for iOS < 17 should be suppressed.

oronbz

oronbz commented on Aug 19, 2024

@oronbz

Any update / ETA for this issue? It's the only warning in our app and it's really annoying.

aayushgulia777

aayushgulia777 commented on Oct 9, 2024

@aayushgulia777

Any updates here?

cemnisan

cemnisan commented on Nov 4, 2024

@cemnisan

Any updates here?

ricsantos

ricsantos commented on Dec 9, 2024

@ricsantos

Just providing an update to all of those waiting:

There is no update.
Enjoy the two compiler warnings.

oronbz

oronbz commented on Apr 1, 2025

@oronbz

Almost a full year... Can we please give it some love?

sanchan

sanchan commented on Jun 30, 2025

@sanchan

This issue will reach the legal drinking age before it's resolved.

ikarus6941

ikarus6941 commented on Jul 3, 2025

@ikarus6941

Any updates here? It’s already 2025.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @sanchan@ricsantos@ionutivan@oronbz@ikarus6941

        Issue actions

          Don't show 'isAdvertiserTrackingEnabled' deprecation warning below iOS 17 · Issue #2371 · facebook/facebook-ios-sdk