Hello,
Welcome to our Microsoft Q&A platform!
I tested the function code on a physical device and a simulator, both work fine. To test the RequestTrackingAuthorization
method, you need to enable the Allow Apps to Request to Track option on the device as the following picture shown:
And the App Tracking Transparency framework is only supported in iOS 14+, please make sure you've updated the Xcode to the 14+ version and test the code in the iOS 14 device.
Best Regards,
Jarvan Zhang
If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.