Coder Social home page Coder Social logo

Comments (6)

jrendel avatar jrendel commented on June 23, 2024

This lib should work fine saving multiple values. I'll try and dig into this sometime today or tonight and see whats up.

from swiftkeychainwrapper.

hernan43 avatar hernan43 commented on June 23, 2024

Let me preface this by saying I'm a total beginner at Swift programming so forgive my ignorance in advance. I did some low grade debugging and noticed that in setData:

let status: OSStatus = SecItemAdd(keychainQueryDictionary, nil)

        if status == errSecSuccess {
            return true
        } else if status == errSecDuplicateItem {
            return self.updateData(value, forKey: keyName)
        } else {
            return false
        }

It seems like that "apiURL" section always gets a errSecDuplicateItem status.

from swiftkeychainwrapper.

jrendel avatar jrendel commented on June 23, 2024

I just threw in a couple more tests to cover adding multiple strings and updating the save key with different strings. Both are working for me. I'd suggest pulling down my updates and running the tests to make sure you're getting the same results.

For the duplicate issue, are you sure your key names are unique? If you try to save twice to the same key name, you'll hit the duplicate item error status and its going to instead perform an update. Perhaps while debugging, when you get to the duplicate item status return, check what the keyName value is on the next line each time and see if you're saving to the same keyName by accident.

from swiftkeychainwrapper.

hernan43 avatar hernan43 commented on June 23, 2024

The code at the top is exactly what I am using. But I did think of something. I am using this in an OS X application and not in an iOS app. I wonder if the underlying API is different enough on the two platforms that it is causing issues.

from swiftkeychainwrapper.

jrendel avatar jrendel commented on June 23, 2024

I haven't actually tested this with OS X. But I know there are differences between how keychain is handled on OS X and iOS, so that is most likely the cause of you issue.

from swiftkeychainwrapper.

jrendel avatar jrendel commented on June 23, 2024

Closing, as the issue is related to accessing Keychain in OS X, which is not the same as on iOS and out of scope of this library for now.

from swiftkeychainwrapper.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.