Created
July 19, 2021 06:38
-
-
Save baba-s/e39430a5be6fac9a489b3944265d539e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#if UNITY_IOS | |
using UnityEditor; | |
using UnityEditor.Callbacks; | |
using UnityEditor.iOS.Xcode; | |
public static class ATTPostProcessBuild | |
{ | |
[PostProcessBuild] | |
private static void OnPostProcessBuild | |
( | |
BuildTarget buildTarget, | |
string pathToBuiltProject | |
) | |
{ | |
if ( buildTarget != BuildTarget.iOS ) return; | |
var path = pathToBuiltProject + "/Info.plist"; | |
var plistDocument = new PlistDocument(); | |
plistDocument.ReadFromFile( path ); | |
plistDocument.root.SetString | |
( | |
key: "NSUserTrackingUsageDescription", | |
val: "【App Tracking Transparency 承認ダイアログに表示されるメッセージ】" | |
); | |
plistDocument.WriteToFile( path ); | |
} | |
} | |
#endif |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment