I need to add keys to the info plist but there is no way to open the file for editing. The xamarin docs state that there should be 3 tabs , one of them being source, which let me manually add keys. Where is that tab?
All you have to do is click on the blue project icon -on top of the left- and go to the “Build Settings” tab, search “Info. plist” and choose “Info. plist File” section. Then change the information of the section from your folder's name.
plist file. If you need to edit these items, Control-click (or right-click) Info. plist in the sidebar and select Edit Manually. This allows you to add or edit items in raw XML format.
In visual studio 2017 for Windows
Right click on Info.plist and select "Open With"
Select "Generic Plist Editor" from the programs list
Can add/edit keys
You get the 3 tabs when you are editing the info.Plist in the Xamarin Studio. Below is the screen shot from mac.
Here is the source tab in which you could manually add keys and it would be converted to corresponding tags.
There is no problem in manually editing the info.Plist manually by using a text editor of your choice.
In Visual Studio at the time being you can open info.plist with any editor and add your keys between the <dict> </dict>
tags.
An example for camera and gallery permisions:
...
<dict>
...
<key>NSCameraUsageDescription</key>
<string>Message for permission to access camera</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>Message for permission to access gallery</string>
...
</dict>
...
More permissions and details here https://blog.xamarin.com/new-ios-10-privacy-permission-settings/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With