Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

How to add the iOS 14 ATT Support Package on Unity 2017.4 LTS?

Discussion in 'Unity Ads & User Acquisition' started by XANTOMEN, May 8, 2021.

  1. XANTOMEN

    XANTOMEN

    Joined:
    Dec 18, 2012
    Posts:
    41
    Hi,

    I've been looking at the documentation and playing around, and I can't figure out how to add the iOS 14 Support Package on one of the 2017.4 LTS versions, as the documentation instructs adding it through the Package Manager... but 2017 does not have an UI for the Package Manager.

    I've seen in other posts a mention that technically the Package Manager exists on 2017, it just does not have an UI... but then no mention on how to use it without an UI.

    So, I'm at a crossroads, as there's some reasons why we would like the game to stay in Unity 2017, but also need ATT compliance on it, and I don't know if this is possible or I should 100% give up and update the project to a newer version of Unity.

    Can anyone provide me with some knowledge here? I'd really appreciate it.

    Thank you!

    Xanto
     
  2. xjjon

    xjjon

    Joined:
    Apr 15, 2016
    Posts:
    591
  3. XANTOMEN

    XANTOMEN

    Joined:
    Dec 18, 2012
    Posts:
    41
    Hi,

    it's not about downloading, it's about the step "In the Unity Editor, open the Unity Package Manager window" not being possible when the Package Manager window does not exist in Unity 2017. Therefore, I need a replacement for that step.
     
  4. xjjon

    xjjon

    Joined:
    Apr 15, 2016
    Posts:
    591
    I think you can just ignore that step

    The source is included in the github repo:

    https://github.com/Unity-Technologi...me/iOSTransparency/ATTrackingStatusBinding.cs

    Basically just add this code

    Code (CSharp):
    1. var status = ATTrackingStatusBinding.GetAuthorizationTrackingStatus();
    2.  
    3. if (status == ATTrackingStatusBinding.AuthorizationTrackingStatus.NOT_DETERMINED)
    4. {
    5.                    
    6.     ATTrackingStatusBinding.RequestAuthorizationTracking();
    7. }
     
    XANTOMEN likes this.
  5. ap-unity

    ap-unity

    Unity Technologies

    Joined:
    Aug 3, 2016
    Posts:
    1,519
    @XANTOMEN

    The minimum supported version of the package is 2018.4.

    However, as xjjon pointed out, it is an open source package, so you can just download the repo and add the com.unity.ads.ios-support directory to your project

    You are going to run into some compiler errors because this was made with some C# features that are only available in Scripting Runtime 4.x and 2017.4 only supports Scripting Runtime 3.5.

    But these errors are fixable. It mostly consists of replacing null propagating operators with additional null checks or interpolated strings ($"[Unity SKAdNetwork Parser] Unable to parse SKAdNetwork file: {source.Path}") with the concatenated strings ("[Unity SKAdNetwork Parser] Unable to parse SKAdNetwork file: " + source.Path)
     
    XANTOMEN likes this.