Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Bug No support for iOS 12/13?

Discussion in 'Unity Mediation' started by SimonOliver, Oct 27, 2022.

  1. SimonOliver

    SimonOliver

    Joined:
    Jul 16, 2007
    Posts:
    30
    Since upgrading to Unity Mediation from Unity ads, we're seeing crashes that didn't previously happen, related to the missing AppTrackingTransparency framework. We're using the "iOS 14 Advertising support" package v1.2.0.

    Previously the AppTrackingTransparency was only loaded on demand (weakly linked to the binary and loaded as needed) so worked fine on devices with iOS 12/13. Now it seems the UnityMediationSdk is strongly linking to AppTrackingTransparency framework, forcing it to load on start and crash devices with older versions of iOS.

    Is there a workaround or does Unity Mediation not support older devices?

    Thanks,
    Simon
     
  2. iddqd

    iddqd

    Joined:
    Apr 14, 2012
    Posts:
    503
    Last edited: Nov 1, 2022
  3. SimonOliver

    SimonOliver

    Joined:
    Jul 16, 2007
    Posts:
    30
    For anyone else encountering this - it does work, but you'll need to enforce weak linking in post build script eg:

    Code (CSharp):
    1. string projectPath = pathToBuiltProject + "/Unity-iPhone.xcodeproj/project.pbxproj";
    2.                
    3. PBXProject pbxProject = new PBXProject();
    4. pbxProject.ReadFromFile(projectPath);
    5.                
    6. // Add in weak linking of AppTrackingTransparency.framework - this is essential for
    7. // Support for older devices (pre iOS 14)
    8. string targetGUID = pbxProject.GetUnityMainTargetGuid();
    9. pbxProject.AddFrameworkToProject(targetGUID, "AppTrackingTransparency.framework", true);
     
    DeclanMcPartlin likes this.