BluetoothAPIPostProcessBuild.cs 903 B

1234567891011121314151617181920212223242526272829303132
  1. #if UNITY_IOS
  2. using UnityEngine;
  3. using UnityEditor;
  4. using UnityEditor.Callbacks;
  5. using System.Collections;
  6. using UnityEditor.iOS.Xcode;
  7. using System.IO;
  8. public class BluetoothAPIPostProcessBuild
  9. {
  10. //[PostProcessBuild]
  11. //public static void ChangeXcodePlist(BuildTarget buildTarget, string pathToBuiltProject)
  12. //{
  13. // if (buildTarget == BuildTarget.iOS)
  14. // {
  15. // // Get plist
  16. // string plistPath = pathToBuiltProject + "/Info.plist";
  17. // PlistDocument plist = new PlistDocument();
  18. // plist.ReadFromString(File.ReadAllText(plistPath));
  19. // // Get root
  20. // PlistElementDict rootDict = plist.root;
  21. // rootDict.SetString("NSBluetoothAlwaysUsageDescription", "Uses Bluetooth");
  22. // // Write to file
  23. // File.WriteAllText(plistPath, plist.WriteToString());
  24. // }
  25. //}
  26. }
  27. #endif