Xamarin Auth Store钥匙扣在ios10升级后无法正常工作

Zib*_*eah 34 xamarin.ios xamarin xamarin.auth

我正在使用Xamarin.Auth(https://components.xamarin.com/view/xamarin.auth/)存储我的凭据,就像我一直以来一样.

var accountStore = AccountStore.Create ();
foreach (var account in  accountStore.FindAccountsForService("myAppName"))
    accountStore.Delete (account, "myAppName");

AccountStore.Create().Save(acc, "myAppName");
Run Code Online (Sandbox Code Playgroud)

升级到iOS 10后,我收到此错误存储凭据:

"Could not save account to KeyChain: -34018"

at Xamarin.Auth.KeyChainAccountStore.Save (Xamarin.Auth.Account account,System.String serviceId) [0x000b2] in <402cf9b3716845b3bdddef581cb33a3e>:0 
Run Code Online (Sandbox Code Playgroud)

安装最新版本1.2.3.1问题似乎只存在于SIMULATOR上

小智 68

我正在挖掘Pat在评论中发送的链接: bugzilla.xamarin.com/show_bug.cgi?id=43514

Pavel Sich发现了一条有用的评论,他说:

只需确保在Entitlements中启用钥匙串访问权限,并选择Simulator(Debug)版本的权利.默认情况下,未设置此项.

在我的xamarin解决方案中,我双击.IOS项目打开选项窗格,选择IOS Bundle Signing并将Platform选择框从"iPhone"更改为"iPhoneSimulator",然后将字段Custom Entitlements设置为我的Entitlements.plist.现在它对我来说很好.

请注意,这是在Thibault D.在上一个答案中建议编辑Entitlement.plist之后.

希望这可以帮助.


Thi*_* D. 11

根据这个帖子,你可以在你的捆绑歌唱配置中添加一个空的权利文件:

<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|iPhoneSimulator' ">
  ...
  <CodesignEntitlements>Entitlements.plist</CodesignEntitlements>
</PropertyGroup>
Run Code Online (Sandbox Code Playgroud)

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>
</dict>
</plist>
Run Code Online (Sandbox Code Playgroud)

  • 我将此添加到我的Entitlements.plist中......同样的问题!<key> keychain-access-groups </ key> <array> <string> MyAppID </ string> </ array> (2认同)
  • 我已经编辑了我的答案,其中包含有关如何获取权利文件以供构建配置使用的说明。 (2认同)