Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
450 views
in Technique[技术] by (71.8m points)

xamarin.ios - Xamarin Auth Store Keychain not working after ios10 upgrade

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");

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 

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

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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

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.

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.

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

Hope this helps.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...