Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

[RELEASED] iOS 14 IDFA - App Tracking Transparency for Unity

Discussion in 'Assets and Asset Store' started by manelizzard, Jul 28, 2020.

  1. manelizzard

    manelizzard

    Joined:
    Feb 4, 2015
    Posts:
    23


    Requirements:
    - Unity 2018 or higher
    - iOS Deployment Target 11.0 or higher
    - XCode 12.0 or higher

    Be prepared for iOS 14

    Later this year Apple will require your apps/games to request user's authorization in order to obtain the Identifier for Advertising (IDFA), used to optimize and maximize your Ads revenue.

    With this package, you can meet Apple's requirements just with one line of code. Forget about hard native integrations and huge plugins for such a small task. This plugin also supports iOS lower versions.

    Integrate it now and forget about headaches when iOS 14 gets officially released. Give your users enough time to get your app/game updated and ready for iOS 14, so when the time comes, you will be all set up.

    >> Get it here <<
    https://assetstore.unity.com/packag...ing-transparency-for-unity-ios-14-idfa-174256

    How to use?

    Code (CSharp):
    1. AppTrackingTransparency.OnAuthorizationRequestDone += OnAuthorizationRequestDone;
    2. AppTrackingTransparency.RequestTrackingAuthorization();


    First free installs

    For this beautiful Unity community and until I'm allowed, DM me to request a voucher.

    Official Website

    Issues

    Changelog:

    2.0
    - Support for Unity Editor 2018
    - AppTrackingTransparency.TrackingAuthorizationStatus property to read current authorization status
    - Customizable popup message through Editor Settings (Window/Balaso/App Tracking Transparency/Settings)
    - Support for adding SkAdNetworkIds for SkAdNetwork. This plugin does not include the ability to show ads, you'll need to use your favorite ads platform SDK.
    - Support for registerAppForAdNetworkAttribution() and updateConversionValue() methods for SkAdNetwork

    1.3
    - Enable bitcode

    1.2
    - Small fixes for better compatibility

    1.1
    Compatibility fixes:
    - Unity 2019 or higher
    - iOS Deployment Target 10.0 or higher
    - XCode 12.0 or higher

    1.0: Initial release
     
    Last edited: Sep 7, 2020
  2. mertcankurum

    mertcankurum

    Joined:
    Jul 20, 2017
    Posts:
    2
    Is it possible to get it for Unity 2019.4 ?
     
  3. manelizzard

    manelizzard

    Joined:
    Feb 4, 2015
    Posts:
    23
    Hello @mertcankurum,

    It supports Unity version 2019.3.10 or higher, so you can use it in Unity 2019.4. However, if you find any issue, do not hesitate to report it here
     
  4. mertcankurum

    mertcankurum

    Joined:
    Jul 20, 2017
    Posts:
    2
    Ups sorry, my fault, I was trying to ask it for 2018.4 LTS version.
     
  5. manelizzard

    manelizzard

    Joined:
    Feb 4, 2015
    Posts:
    23
    No, the earliest Unity Editor version supported by the plugin is 2019 onwards. I'm sorry
     
  6. andymads

    andymads

    Joined:
    Jun 16, 2011
    Posts:
    1,526
    Can you clarify - does it work on any version of 2019, or is it 2019.3.10+?
     
  7. DaveMExient

    DaveMExient

    Joined:
    Jan 23, 2020
    Posts:
    1
    Hi @manelizzard - another version question: Is there a "Unity engine" reason for the 2019 requirement?

    In other words - do you believe that Unity 2019.x is the minimum requirement for AppTrackingTransparency (irrespective of your plugin)?
     
  8. andymads

    andymads

    Joined:
    Jun 16, 2011
    Posts:
    1,526
    I emailed him and he said "It has been developed and tested under Unity 2019.3, but I think it will work under any 2019 version. 2018 is not supported. "
     
  9. manelizzard

    manelizzard

    Joined:
    Feb 4, 2015
    Posts:
    23
    Hello @DaveMExient @andymads,

    Yes, 2019.3 is mandatory. The plugin is using some Unity Editor iOS tools not available (at least by the time being) in Unity 2018.

    Feel free to PM and I'll send you a voucher to test the plugin free of charge.

    EDIT: After some investigation, we can say the lowest Unity version supported is 2019.3. Older versions can use the plugin, but will need to configure XCode project manually as explained later in this thread.
     
    Last edited: Aug 6, 2020
  10. manelizzard

    manelizzard

    Joined:
    Feb 4, 2015
    Posts:
    23
    The reason of using Unity 2019.3 or higher is to automatically add some required frameworks to the XCode build and the customizable popup message.

    These frameworks are:
    • AppTrackingTransparency.framework
    • AdSupport.framework
    And the Info.plist has to be modified with the popup message, under the key named
    NSUserTrackingUsageDescription


    You can safely use the plugin with earlier Unity versions if you complete those steps manually. See xcode and plist attached screenshots to see how the XCode project needs to be configured
     

    Attached Files:

  11. andymads

    andymads

    Joined:
    Jun 16, 2011
    Posts:
    1,526
    The plugin has a bug which prevents it being used with 2019.2 and likely earlier. I have emailed the author so hopefully he will fix.

    Assets/Balaso Software/Runtime/AppTrackingTransparency.cs Line 180 should be:

    targetId = project.TargetGuidByName("Unity-iPhone");
     
  12. manelizzard

    manelizzard

    Joined:
    Feb 4, 2015
    Posts:
    23
    Thanks @andymads, version 1.2 with the fix is on the way. Hopefully Unity reviews it and makes it available in the following days.
     
  13. manelizzard

    manelizzard

    Joined:
    Feb 4, 2015
    Posts:
    23
    Version 1.2 is now live
     
  14. natepacyga

    natepacyga

    Joined:
    Apr 7, 2015
    Posts:
    20
  15. devasi

    devasi

    Joined:
    Nov 29, 2017
    Posts:
    2
    Hi @manelizzard
    Please help me to solve error it's getting during the build in Xcode
    Detail:
    Unity v2020.1.0f1
    Xcode v11.6
    target iOS11
     

    Attached Files:

  16. manelizzard

    manelizzard

    Joined:
    Feb 4, 2015
    Posts:
    23
    Thanks for the suggestion @natepacyga. Will study the request and see what can we do.
     
  17. manelizzard

    manelizzard

    Joined:
    Feb 4, 2015
    Posts:
    23
    Hello. This plugin can only be built on XCode 12. Please try with XCode 12 Beta 4.

    Best,
     
  18. devasi

    devasi

    Joined:
    Nov 29, 2017
    Posts:
    2
    thanks for reply checking :)
     
  19. ATurati

    ATurati

    Joined:
    Aug 19, 2020
    Posts:
    6
    Hello @manelizzard , just to be clear (before purchase), if I follow your XCode steps to add everything manually, it will work on Unity 2018.4 ?

    I can't update all my apps to 2019 because I'm using some custom editor tools that were deprecated for 2019
     
  20. manelizzard

    manelizzard

    Joined:
    Feb 4, 2015
    Posts:
    23
    Let's synch on DM :)
     
    mahmoud93p likes this.
  21. natepacyga

    natepacyga

    Joined:
    Apr 7, 2015
    Posts:
    20
    @manelizzard Why does this have to basically use the cutting edge XCode? Is that your mandate or Apple's? I use Unity Cloud Build and (currently) the highest version I can use is 11.4. If I need to wrap this myself I can, but I would like to continue using UCB if possible, unless this is an Apple reason you have to use XCode 12...? Let me know.
     
  22. ATurati

    ATurati

    Joined:
    Aug 19, 2020
    Posts:
    6
    Feedback here, it works great, Unity 208.4.16f1 following the instructions above

    I only have one question, is there a way to pop the notification more than once? (I know, they said no, still, would like to know)
     
  23. manelizzard

    manelizzard

    Joined:
    Feb 4, 2015
    Posts:
    23
    By the time being, the AppTrackingTransparency framework on iOS persists user's decision and won't show the pop-up twice, unless a fresh install is done.

    Let's see if they change this behavior on the official release, but I would not expect it.
     
  24. manelizzard

    manelizzard

    Joined:
    Feb 4, 2015
    Posts:
    23
    Yes, the only way to build an iOS 14 project is with XCode 12, as far as I am concerned
     
  25. mahmoud93p

    mahmoud93p

    Joined:
    Feb 11, 2015
    Posts:
    58
    @manelizzard please support your tool to unity 2018 we need this as soon as possible.
    Today admob start to Descending cpm.
     
  26. manelizzard

    manelizzard

    Joined:
    Feb 4, 2015
    Posts:
    23
    Hello. See the first post of this thread, there is it explained how to be used in Unity 2018
     
  27. FamilyGamesTime

    FamilyGamesTime

    Joined:
    Apr 27, 2017
    Posts:
    13
    I've been trying to get this working with Unity Cloud Build, but keep getting this error, any ideas? Everything in the Balaso Software folder has been added to the project source control.

    165: ▸ ❌; ld: framework not found AppTrackingTransparency
    166: ▸ ❌; clang: error: linker command failed with exit code 1 (use -v to see invocation)
     
  28. manelizzard

    manelizzard

    Joined:
    Feb 4, 2015
    Posts:
    23
    Hello. Which XCode version is running on Cloud Build? AppTrackingTransparency framework is only available in XCode 12
     
  29. mahmoud93p

    mahmoud93p

    Joined:
    Feb 11, 2015
    Posts:
    58
    Can you upload AppTrackingTransparency framework in google drive for us
    manelizzard

    because i have this error in xcode 11 last version
    Undefined symbol: _OBJC_CLASS_$_ATTrackingManager
     
  30. FamilyGamesTime

    FamilyGamesTime

    Joined:
    Apr 27, 2017
    Posts:
    13
    Thanks, that would be the problem. They don't have xcode 12 yet in unity cloud build.
     
  31. wana7262

    wana7262

    Joined:
    Jul 2, 2012
    Posts:
    97
    Need Help, getting these errors while building Using Unity 2018.1.2f1
    Code (CSharp):
    1. Assets/Balaso Software/Runtime/AppTrackingTransparency.cs(128,28): error CS1644: Feature `interpolated strings' cannot be used because it is not part of the C# 4.0 language specification
     
  32. manelizzard

    manelizzard

    Joined:
    Feb 4, 2015
    Posts:
    23
    Hello,

    Interpolated string are available in .NET 4.x. You should be able to fix this following these steps: https://stackoverflow.com/a/51851721
     
  33. wana7262

    wana7262

    Joined:
    Jul 2, 2012
    Posts:
    97
    Thanks for quick support :) just last question i managed to build my game added frameworks manually, but no pop up shown on start of game am i missing something? i also added example script to gameObject of initial scene.
     
  34. manelizzard

    manelizzard

    Joined:
    Feb 4, 2015
    Posts:
    23
    Are you running your game on an iOS 14 device? Pop-up will only be shown from iOS 14 onwards
     
  35. ATurati

    ATurati

    Joined:
    Aug 19, 2020
    Posts:
    6
    BTW @manelizzard if you remove "OnPostprocessBuild" from that script and move it to a new one inside an "Editor" folder, you can make the plugin work on Unity 2018 without the need to add the frameworks manually
     
  36. ATurati

    ATurati

    Joined:
    Aug 19, 2020
    Posts:
    6
    And for anyone that will need to Add the SKAdNetworks automatically, the next code can be added inside the
    OnPostprocessBuild(BuildTarget buildTarget, string buildPath)

    Code (CSharp):
    1.  
    2. PlistElementDict root = plist.root;
    3. PlistElementArray urls = root.CreateArray ("SKAdNetworkItems");
    4. //AdMob
    5. PlistElementDict dic = urls.AddDict ();
    6. dic.SetString ("SKAdNetworkIdentifier", "cstr6suwn9.skadnetwork");
    7. //IrounSouce
    8. PlistElementDict dic2 = urls.AddDict ();
    9. dic2.SetString ("SKAdNetworkIdentifier", "SU67R6K2V3.skadnetwork");
    10. //Unity Ads
    11. PlistElementDict dic3 = urls.AddDict ();
    12. dic3.SetString ("SKAdNetworkIdentifier", "4DZT52R2T5.skadnetwork");
    13. PlistElementDict dic4 = urls.AddDict ();
    14. dic4.SetString ("SKAdNetworkIdentifier", "bvpn9ufa9b.skadnetwork");
    15.  
    Finding this would have saved me about 2 hours, so I hope I can help 1 person learn how to make a dictionary inside the info.plist
     
  37. andymads

    andymads

    Joined:
    Jun 16, 2011
    Posts:
    1,526
    @manelizzard can you add functionality to the plugin so that we can query the status of the Tracking setting without showing the Apple popup?

    I have my own in-game UI popup which will explain why the tracking should be allowed before showing the Apple popup. If the user has disabled all app requests in Settings then I don't want to show my own UI popup - but I need to query that setting.

    IMG_0060.jpg
     
  38. manelizzard

    manelizzard

    Joined:
    Feb 4, 2015
    Posts:
    23
    Will be available on next release. Keep track of it here: https://github.com/Balaso-Software/app-tracking-transparency-for-unity/issues/6
     
  39. andymads

    andymads

    Joined:
    Jun 16, 2011
    Posts:
    1,526
    Just wanted to add a note for people to be careful what code you call from the handler function. It's not on the main thread which means some Unity calls are not allowed. I found out when trying to call Time.frameCount.
     
  40. andymads

    andymads

    Joined:
    Jun 16, 2011
    Posts:
    1,526
    manelizzard likes this.
  41. cometa93

    cometa93

    Joined:
    Mar 5, 2014
    Posts:
    31

    Undefined symbols for architecture arm64:

    "_OBJC_CLASS_$_ATTrackingManager", referenced from:

    objc-class-ref in libAppTrackingTransparency.a(AppTrackingTransparency.o)

    ld: symbol(s) not found for architecture arm64

    clang: error: linker command failed with exit code 1 (use -v to see invocation)


    Anyone had similar issue? Building using xCode 12.0 beta 6?

    As I'm not the expert within iOS, I barely know how to start with such an issue in xCode x Unity.
     
  42. manelizzard

    manelizzard

    Joined:
    Feb 4, 2015
    Posts:
    23
    Hello @cometa93, which version of the plugin are you using? Version 1.3.0 should include arm64 support.
     
    Last edited: Sep 7, 2020
  43. cometa93

    cometa93

    Joined:
    Mar 5, 2014
    Posts:
    31
    I'm using 1.2.0 package version. Is it possible that I'm doing something wrong OR it's because of unity 2020.1.2f1 version?
     
  44. manelizzard

    manelizzard

    Joined:
    Feb 4, 2015
    Posts:
    23
    I'm sorry, I meant plugin version 1.3 (edited post above). Please, can you install the latest version and try again?
     
  45. cometa93

    cometa93

    Joined:
    Mar 5, 2014
    Posts:
    31
    Ok, so I assume unity have a bug, as I can't import it from UPM and asset store is redirecting me to UPM xD
    I will manually try to change manifest file and we will see.
     
  46. homenetgames-jacek

    homenetgames-jacek

    Joined:
    Jun 8, 2015
    Posts:
    13
    Thanks for the info,
    Apple statement says: "To give developers time to make necessary changes, apps will be required to obtain permission to track users starting early next year"
    it is still unclear for me - if we will left apps not updated and won't ask for the permission - will iOS 14 return IDFA zeroed (and damage eCPMs) or they withdraw/disable this from iOS 14 until next year?
     
  47. manelizzard

    manelizzard

    Joined:
    Feb 4, 2015
    Posts:
    23
    As per my understanding and reads, it will keep working as of now until next year. That means you'll get IDFA even if you don't ask users for permission. Limited Ad Tracking options may also apply (as they are right now).

    The good thing is you can A/B test your popup acceptance rate meanwhile it is not mandatory, so you can optimize your acceptance rate and be ready for early next year.
     
  48. cometa93

    cometa93

    Joined:
    Mar 5, 2014
    Posts:
    31
    Just wanted to say, I've imported the package in older unity to make sure it's fresh, but I saw no change in git source files ( others than .meta files). Even if I assumed file was same I've tried to built it, maybe there is some magic in xCode iDunno... But result was same, so I feel like I'm unable to download 1.3 package from AssetStore, or it's not fixed.

    The build error is the same.
     
  49. andymads

    andymads

    Joined:
    Jun 16, 2011
    Posts:
    1,526
    With the latest iOS 14 beta (7) you now get a non-zero IDFA again.
     
    homenetgames-jacek likes this.
  50. manelizzard

    manelizzard

    Joined:
    Feb 4, 2015
    Posts:
    23
    Version 2.0 is now available with:

    - Support for Unity Editor 2018
    - AppTrackingTransparency.TrackingAuthorizationStatus property to read current authorization status
    - Customizable popup message through Editor Settings (Window/Balaso/App Tracking Transparency/Settings)
    - Support for adding SkAdNetworkIds for SkAdNetwork. This plugin does not include the ability to show ads, you'll need to use your favorite ads platform SDK.
    - Support for registerAppForAdNetworkAttribution() and updateConversionValue() methods for SkAdNetwork

    See more details here: https://balaso-software.github.io/app-tracking-transparency-for-unity/
     
unityunity