ios10 升级后 Xamarin Auth 商店钥匙串不起作用 [英] Xamarin Auth Store Keychain not working after ios10 upgrade

查看:25
本文介绍了ios10 升级后 Xamarin Auth 商店钥匙串不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I'm using Xamarin.Auth (https://components.xamarin.com/view/xamarin.auth/) to store my credentials, as I've always done.

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

AccountStore.Create().Save(acc, "myAppName");

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

After the upgrade to iOS 10 I get this error storing credentials:

"Could not save account to KeyChain: -34018"

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

最新安装版本1.2.3.1问题似乎只在模拟器上持续存在

Latest version installed 1.2.3.1 The problem seems to persist only on the SIMULATOR

推荐答案

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

I was digging through the link Pat sent in the comment: bugzilla.xamarin.com/show_bug.cgi?id=43514

并找到了 Pavel Sich 的有用评论,他说:

And found a helpfull comment by Pavel Sich, he said:

只需确保在授权中启用钥匙串访问,并为模拟器(调试)构建选择授权.默认情况下未设置.

Just make sure you enable the keychain access in Entitlements and select the entitlements for Simulator (Debug) builds too. By default this is not set.

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

In my xamarin solution, I double clicked the .IOS project to open the options pane, selected IOS Bundle Signing and changed the Platform select box from "iPhone" to "iPhoneSimulator", then set the field Custom Entitlements to my Entitlements.plist. Now it's working fine for me.

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

Just a note, this is after editing the Entitlement.plist as suggested by Thibault D. in the previous answer.

希望这会有所帮助.

这篇关于ios10 升级后 Xamarin Auth 商店钥匙串不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆