10 private const bool ENABLED =
true;
12 private const string PHOTO_LIBRARY_USAGE_DESCRIPTION =
"Save media to Photos";
13 private const string CAMERA_USAGE_DESCRIPTION =
"Open Camera to get data of devicecamera !";
16#pragma warning disable 0162
18 public static void OnPostprocessBuild( BuildTarget target,
string buildPath )
23 if( target == BuildTarget.iOS )
25 string pbxProjectPath = PBXProject.GetPBXProjectPath( buildPath );
26 string plistPath = Path.Combine( buildPath,
"Info.plist" );
29 PlistDocument plist =
new PlistDocument();
30 plist.ReadFromString( File.ReadAllText( plistPath ) );
32 PlistElementDict rootDict = plist.root;
33 rootDict.SetString(
"NSPhotoLibraryUsageDescription", PHOTO_LIBRARY_USAGE_DESCRIPTION );
34 rootDict.SetString(
"NSPhotoLibraryAddUsageDescription", PHOTO_LIBRARY_USAGE_DESCRIPTION );
35 rootDict.SetString(
"NSCameraUsageDescription", CAMERA_USAGE_DESCRIPTION );
38 File.WriteAllText( plistPath, plist.WriteToString() );
41#pragma warning restore 0162