Skip to content

Instantly share code, notes, and snippets.

@baba-s
Created July 19, 2021 06:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save baba-s/e39430a5be6fac9a489b3944265d539e to your computer and use it in GitHub Desktop.
Save baba-s/e39430a5be6fac9a489b3944265d539e to your computer and use it in GitHub Desktop.
#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