Created
September 29, 2018 03:14
-
-
Save dialupnoises/d1e36515b12191caa4390a94d948af1b to your computer and use it in GitHub Desktop.
This file contains hidden or 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.Callbacks; | |
using UnityEditor; | |
using UnityEditor.iOS.Xcode; | |
using System.IO; | |
public class PostProcessXCodeCalendarFix | |
{ | |
[PostProcessBuild] | |
public static void ChangeXcodePlist(BuildTarget buildTarget, string pathToBuiltProject) | |
{ | |
if(buildTarget == BuildTarget.iOS) | |
{ | |
// Get plist | |
string plistPath = pathToBuiltProject + "/Info.plist"; | |
var plist = new PlistDocument(); | |
plist.ReadFromString(File.ReadAllText(plistPath)); | |
// Get root | |
var rootDict = plist.root; | |
rootDict.SetString("NSCalendarsUsageDescription", "Calendar access used by third party advertising partners."); | |
// Write to file | |
File.WriteAllText(plistPath, plist.WriteToString()); | |
} | |
} | |
} | |
#endif |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment