'Unity Xcode Info.plist

I have such a problem.

I am building an application in Unity on iOS, filling Info.plist in post-processing script, however, the permissions that I add through post-processing do not work in the application and are not offered to the user, but if I fill info.plist manually in Xcode, then everything works and the user is prompted to give permission in the application.

'''

    private static void ChangeXcodePlist(BuildTarget buildTarget, string pathToBuildProject)
    {
        string plistPath = pathToBuildProject + "/Info.plist";
        PlistDocument plist = new PlistDocument();
        plist.ReadFromString(File.ReadAllText(plistPath));
        PlistElementDict rootDict = plist.root;
   
        rootDict.values.Add(CameraKey, new PlistElementString(CameraValue));
        rootDict.values.Add(PhotoKey, new PlistElementString(PhotoValue));
        rootDict.values.Add(MicroKey, new PlistElementString(MicroValue));
        rootDict.values.Add(AdvertisingAttributionReportEndpointURLKey, new PlistElementString(AdvertisingAttributionReportEndpointURLValue));
        
        File.WriteAllText(plistPath, plist.WriteToString());
    }
    
 

'''



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source