Skip to content

Instantly share code, notes, and snippets.

@drZool
Created December 15, 2016 07:35
Show Gist options
  • Select an option

  • Save drZool/2aef2d7ef9963cb06caa1f4aab94932b to your computer and use it in GitHub Desktop.

Select an option

Save drZool/2aef2d7ef9963cb06caa1f4aab94932b to your computer and use it in GitHub Desktop.
Prior 5.2.2p1 ios build would fail upload to testflight/appstore if info.plist did not have UIRequiresFullScreen = true. This fixes that
using System.IO;
using UnityEngine;
using UnityEditor;
using System.Collections;
using UnityEditor.Callbacks;
#if UNITY_IOS
using UnityEditor.iOS.Xcode;
#endif
public class IosPostBuild {
[PostProcessBuild]
private static void OnProcessPostBuild (BuildTarget buildTarget, string path)
{
#if UNITY_IOS
if (buildTarget == BuildTarget.iPhone ) {
// Add url schema to plist file
string plistPath = path + "/Info.plist";
PlistDocument plist = new PlistDocument();
plist.ReadFromString(File.ReadAllText(plistPath));
// Get root
PlistElementDict rootDict = plist.root;
rootDict.SetBoolean("UIRequiresFullScreen",true);
plist.WriteToFile(plistPath);
}
#endif
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment