0

I have iOS application (that works properly on iOS) and it has enabled destination: Mac(Designed for iPad). When run it on mac M1, the dialog doesnt appear and the code that it used to ask permissions for tracking always returns ATTrackingManager.AuthorizationStatus.notDetermined The code it here:

if #available(iOS 14, *) {
    ATTrackingManager.requestTrackingAuthorization { [weak self] status in
        switch status {
        case .authorized:
            DispatchQueue.main.async {
                self?.didTrackingAuthorized?()
            }
            // Tracking authorization dialog was shown
            // and we are authorized
        case .denied:
            // Tracking authorization dialog was
            // shown and permission is denied
            print("FB - Denied")
        case .notDetermined:
            self?.setup()
            print("FB - Not Determined")
        case .restricted:
            print("FB - Restricted")
        @unknown default:
            print("FB - Unknown")
        }
    }
}

In documentation I read the Note about such behaviour: If you call ATTrackingManager.trackingAuthorizationStatus in macOS, ATTrackingManager.AuthorizationStatus.notDetermined returns.

So the question is how in this case properly ask user permission for tracking activity on macos?

Melany
  • 466
  • 7
  • 20
  • 1
    I don't believe that ad tracking is available on macOS. You will always get `.notDetermined` and if you call `requestTrackingAuthorization` then no dialog will be shown. Your app should act as if `.denied` is the response – Paulw11 Jan 25 '23 at 20:23
  • 1
    The advertising identifier is not available on macOS and will always return zeros – Paulw11 Jan 25 '23 at 20:29
  • @Paulw11 so it is not required to be called on macos? I thought that application should ask in this case – Melany Jan 25 '23 at 20:52
  • 1
    It can ask (and should because that is the correct code to have for a .notDetermined case) but the dialog will not be shown and your completion handler will not be called. The rest of your code should treat `.denied` and `.notDetermined` the same – Paulw11 Jan 25 '23 at 20:59

0 Answers0