matthewpalmer / Locksmith

A powerful, protocol-oriented library for working with the keychain in Swift.
MIT License
2.92k stars 266 forks source link

not saving data swift 3 #163

Open gaborcsontos opened 7 years ago

gaborcsontos commented 7 years ago

Hello.

Currently I tried to implement the Locksmith, but I still get an error, while it's not saving any data.

`
do { //Locksmith save usercredentials try Locksmith.saveData(["user_Id": "12"], forUserAccount: "myUserAccount")

    }

    catch {
        print("didnt saved")
        //"could not save the data into keychain"
    }
    //retrieve datas from keychain
    let dictionary = Locksmith.loadDataForUserAccount("myUserAccount")`

Any ideas? Always getting nil and dictionary [String : Any]? 0 key/value pairs some at the console

gaborcsontos commented 7 years ago

Well the issue is only on device. On simulator it works well. I enabled keychain sharing as well, but it not works on phone.. Any ideas?

shingsoso commented 7 years ago

same Problem ... Any Help?

gaborcsontos commented 7 years ago

Well. Now it is working, but actually I didn't know how exactly I was able to fix.

I read the documentation about keychain sharing. If you enable keychain sharing it works on simulator.

What I did: Went to developer profile, I created an AppId in the Certificates and a provisionary profile for the app. I removed my developer profile from the Xcode and added again(downloaded the new provisionary profile as well). After it started to work, but I am not sure, because of it.

gaborcsontos commented 7 years ago

shingsoso does it work for you as well after doing what I wrote?