How to update info.plist with code?

2019-09-10 03:35发布

问题:

I am building an app in Xamarin, using Xamarin Studio / XCode / Visual Studio. I need to use the Facebook SDK for the iOS project, but the instructions require adding the code shown on that link to info.plist. However, if I open info.plist in any of those IDEs, I get a window structured like a form to edit the file, so I can't add the code in as stated by the tutorial? Under Advanced, there is an option to add URL Types, but I am not sure what to put in here, or if this is the right option to use.

Thanks

回答1:

First, go to your Xcode project and find the info.plist file:

You should see something like this:

Then right click the file and choose Open As, and then Source Code:

And then it should allow you to add the Facebook code to your Info.plist file like this:



回答2:

In Xamarin Studio, if you open Info.plist you should be able to switch to the "Source" tab. From there you can either enter a predefined key, or "Custom Property" which can be set to any value.

Info.plist is a text file, so you could also edit it with any text editor outside of your IDE.