Created
September 9, 2021 06:42
-
-
Save Shubham0812/e60acf5da3e37e3ae633eb2718415e3b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { | |
self.registerForAppTrackingTransparency(launchOptions) | |
return true | |
} | |
private func registerForAppTrackingTransparency(_ launchOptions: [UIApplication.LaunchOptionsKey: Any]?) { | |
if #available(iOS 14, *) { | |
ATTrackingManager.requestTrackingAuthorization { (status) in | |
if status != .notDetermined && status != .restricted { | |
if status == .authorized { | |
print("authorised") | |
} else if status == .denied { | |
print("denied") | |
} | |
} | |
} | |
} else { | |
/// fallback | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment