facebook-ios-sdk
facebook-ios-sdk copied to clipboard
Don't show 'isAdvertiserTrackingEnabled' deprecation warning below iOS 17
Checklist before submitting a bug report
- [X] I've updated to the latest released version of the SDK
- [X] I've searched for existing GitHub issues
- [X] I've looked for existing answers on Stack Overflow, the Facebook Developer Community Forum and the Facebook Developers Group
- [X] I've read the Code of Conduct
- [X] 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"
i have same issue
Same
same
up
same
Same, please fix
Same
Same
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:
https://github.com/facebook/facebook-ios-sdk/blob/7295c425d8ca789a7861472d841468b24d30de9f/FBSDKCoreKit/FBSDKCoreKit/Settings.swift#L408-L423
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:
https://github.com/facebook/facebook-ios-sdk/blob/7295c425d8ca789a7861472d841468b24d30de9f/FBSDKCoreKit/FBSDKCoreKit/Settings.swift#L408-L423
Seems like SDK uses _advertisingTrackingStatusFromATT
only when isDomainHandlingEnabled()
returns true.
https://github.com/facebook/facebook-ios-sdk/blob/7295c425d8ca789a7861472d841468b24d30de9f/FBSDKCoreKit/FBSDKCoreKit/Settings.swift#L388-L394
And isDomainHandlingEnabled
always returns true for iOS >= 17, but not for iOS < 17.
https://github.com/facebook/facebook-ios-sdk/blob/7295c425d8ca789a7861472d841468b24d30de9f/FBSDKCoreKit/FBSDKCoreKit/Internal/DomainHandler/FBSDKDomainHandler.m#L136-L149
So it seems like the warning for iOS < 17 should be suppressed.
Any update / ETA for this issue? It's the only warning in our app and it's really annoying.
Any updates here?