Xamarin.Forms 中iOS模拟器SecureStorage使用

Xamarin.iOS 模拟器使用SecureStorage

需要在Entitlements.plist中进行如下配置

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
  <dict>
    <key>com.apple.developer.default-data-protection</key>
    <string>NSFileProtectionComplete</string>
  </dict>
</plist>

然后,选中Xamarin.iOS项目,右键属性,选中iOS Bundle Signing,将Custom Entitlements 设置为上面配置好的Entitlements。
如下图所示:

即可在模拟器中正常使用SecureStorage了。

原文地址:https://www.cnblogs.com/devin_zhou/p/11434168.html