0

I am using xamarin forms I am trying to use xamarin.Auth to save some informations in the database...and when I did it in android all happend ok ... But in ios I receive this error...

> Xamarin.Auth.AccountStoreException: SaveAsync error = error = Could not save account to KeyChain: -34018
Add Empty Entitlements.plist 
 File /+ New file /+ iOS /+ Entitlements.plist
SecKeyChain.Add returned : -34018
1. Add Keychain Access Groups to the Entitlements file.
2. Turn on the Keychain Sharing switch in the Capabilities section in the app.

I am using these lines in my pcl code behind:

        account.Properties.Add("teste2", "1");
        account.Properties.Add("teste1", "usereee");
        AccountStore.Create().Save(account, "clastech_montana");

enter image description here

It's all I did... and I searched a lot and I don't know how to turn on the keychain or if it all I did is right.. Please, If you can, help me!

enter image description here

there is not a place to enable

Cœur
  • 37,241
  • 25
  • 195
  • 267
Joyce de Lanna
  • 1,473
  • 2
  • 15
  • 39

1 Answers1

1

in your iOS project, open Entitlements.plist, and check "Enable Keychain"

Jason
  • 86,222
  • 15
  • 131
  • 146
  • I am posting a photo of this here..where is it? – Joyce de Lanna Aug 16 '17 at 20:50
  • 2
    and also you may need to ensure that your entitlements.plist "participates" in the bundle that you are creating. Go to Project/[YourProjectName] Options/Build/iOs Bundle Signing and set Custom Entitlements to Entitlements.plist – ubienewbie Feb 06 '18 at 00:27