如何用代码更新info.plist?

时间:2015-12-31 21:30:55

标签: ios xamarin xamarin.ios xamarin-studio

我正在使用Xamarin Studio / XCode / Visual Studio在Xamarin中构建应用程序。我需要对iOS项目使用Facebook SDK,但说明需要将该链接上显示的代码添加到info.plist。但是,如果我在任何这些IDE中打开info.plist,我会得到一个类似于表单的窗口来编辑文件,所以我不能按照教程的说明添加代码?在“高级”下,可以选择添加URL类型,但我不确定要在此处放置什么,或者这是否是正确的选项。

由于

2 个答案:

答案 0 :(得分:2)

在Xamarin Studio中,如果打开Info.plist,您应该可以切换到" Source"标签。从那里,您可以输入预定义的密钥,或者"自定义属性"可以设置为任何值。

Info.plist是一个文本文件,因此您也可以使用IDE外部的任何文本编辑器对其进行编辑。

enter image description here

答案 1 :(得分:2)

首先,转到Xcode项目并找到info.plist文件:

Just open the folder and the file should be there

你应该看到这样的事情:

screenshot of the files on the left sidebar

然后右键单击该文件并选择打开为,然后选择源代码

"Open As/Source Code" selected from the context menu

然后它应该允许您将Facebook代码添加到Info.plist文件中,如下所示:

screenshot of the source code

相关问题