Xamarin.Forms:如何在 Visual Studio 2015 中为 IOS10 添加私钥

Xamarin.Forms: How add Privacy Key in Visual Studio 2015 for IOS10

我想在我的项目中为 Xamarin.Forms 使用 媒体插件 。 但是为了让它在 IOS10 上工作,我需要在我的 IOS 项目的 'Info.plist' 文件中添加一个安全设置。

如此处所述:https://blog.xamarin.com/new-ios-10-privacy-permission-settings/

这里还解释了这些步骤:https://developer.xamarin.com/guides/ios/platform_features/introduction-to-ios10/security-privacy-enhancements/#Setting-Privacy-Keys

但我还是不知道该怎么做。 在第 2 步中说明要执行 'At the bottom of the screen, switch to the Source view.'。问题是我找不到它。

有人知道我的问题的答案吗? 谢谢!

我认为设计器视图在 Visual Studio 中不可用。

使用文本编辑器打开 info.plist 并手动编辑。它只是 XML 所以如果你看一下它,你就会弄清楚它的结构。

然后将其添加到根 <dict> 标记的某处。

<key>NSCameraUsageDescription</key>
<string>This app needs access to the camera to take photos.</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>This app needs access to photos.</string>

如果您想要使用 GUI 进行操作,则必须使用 Xamarin Studio 或直接在 Xcode 中打开它。