Guideline 5.1.1 - Legal - Privacy - Data Collection and Storage

This Is the reason that my game was rejected in AppStoreConnect.

[ ]

I ask users permission but I can't determine what user choose, allow or deny.

So question is that "How to determine users answer, and if it's DENY, what code I must write so my unity ads do not track that user"

Please Help to solve this problem. THANKS FOR READING.

You determine what user chose within the completion handler of requestTrackingAuthorization by analysis status parameter.

Many resources on the web:

https://stackoverflow.com/questions/63587364/how-to-add-the-apptrackingtransparency-permission-to-your-ios-apps
import AppTrackingTransparency
import AdSupport

//NEWLY ADDED PERMISSIONS FOR iOS 14
func requestPermission() {
    if #available(iOS 14, *) {
        ATTrackingManager.requestTrackingAuthorization { status in
            switch status {
            case .authorized:
                // Tracking authorization dialog was shown
                // and we are authorized
                print("Authorized")
                
                // Now that we are authorized we can get the IDFA
                print(ASIdentifierManager.shared().advertisingIdentifier)
            case .denied:
                // Tracking authorization dialog was
                // shown and permission is denied
                print("Denied")
            case .notDetermined:
                // Tracking authorization dialog has not been shown
                print("Not Determined")
            case .restricted:
                print("Restricted")
            @unknown default:
                print("Unknown")
            }
        }
    }
}

much less detailed here:

https://medium.nextlevelswift.com/app-tracking-transparency-framework-in-swift-and-ios-14-5-45f73697174a

Hope that helps.

Guideline 5.1.1 - Legal - Privacy - Data Collection and Storage
 
 
Q