2

I am trying to make a plugin for my unity project to call new ios 14 ATTracking. It doesn't prompt on screen, why ? I am not getting any error and i know that code goes into the if statement. Trying On Simulator, maybe thats why it doesn't work ?

+(void)requestAttPermission:(NSString*)callback
{
 if (@available(iOS 14, *)) {
  [ATTrackingManager requestTrackingAuthorizationWithCompletionHandler:^(ATTrackingManagerAuthorizationStatus status)
   {
      UnitySendMessage("SomeGameObject", [callback UTF8String], "");
   }
 }
}
Çağatay IŞIK
  • 937
  • 6
  • 17
  • 1
    Permissions may be denied by user in settings. I'm not sure that one can do this in simulator. See https://stackoverflow.com/questions/62817164/idfa-ios14-returns-denied-without-displaying-auth-popup/62840480#62840480 – Petr Aug 28 '20 at 09:31
  • Thanks for comment. It was a stupid newbie mistake of mine. Found the answer. – Çağatay IŞIK Aug 28 '20 at 09:47
  • 1
    Note that Apple announced that you've time to implement this permission request until "early next year" as can be read here https://developer.apple.com/news/?id=hx9s63c5 and here https://www.adexchanger.com/mobile/apple-will-delay-its-idfa-changes-in-ios-14-until-early-next-year/ – Bruno Bieri Oct 15 '20 at 06:42

1 Answers1

1

Apparently, it works on the iOS 14 simulator. What I did wrong was that I thought that the AppTrackingTransparency.framework was already added, but it wasn't.

After I added that framework (in Xcode -> Build Phases -> Link Binary With Libraries) it worked.

Iulian Onofrei
  • 9,188
  • 10
  • 67
  • 113
Çağatay IŞIK
  • 937
  • 6
  • 17