'Implementing Opt Out for FBSDKCore in Swift?

I'm trying to comply with iOS 14+ and opt users out of tracking by default but turn it back on if ATTrackingManager.requestTrackingAuthorization comes back as ".authorized".

I found this article that describes how to do it in Android. How is it done in Swift? FB's documents are notoriously sparse on this.

I understand I probably want to set the Info.plist property AutoLogAppEventsEnabled to false. But what about re-enabling it if I get the user's permission through ATTrackingManager?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source