Code Monkey home page Code Monkey logo

Comments (9)

chrobakos avatar chrobakos commented on July 19, 2024

Error codes or something?

from swiftkeychainwrapper.

jtezanos avatar jtezanos commented on July 19, 2024

None so far. I spent 2 days trying to figure out why it was happening, only things I know for sure is that setting a string using: KeychainWrapper.setString("Some String", forKey: "myKey") //or any variation\ - and then trying to grab that set string - will result in nil only on *some devices. Very odd indeed.

from swiftkeychainwrapper.

chrobakos avatar chrobakos commented on July 19, 2024

in
setData(value: NSData, forKey keyName: String) -> Bool
we are adding item into keychain with
SecItemAdd(keychainQueryDictionary, nil)
and it returns OSStatus, which says how operation went. Which OSStatus number are you getting back with error?

from swiftkeychainwrapper.

jrendel avatar jrendel commented on July 19, 2024

Any updates on whether or not this is still occurring? I would like to start cleaning up some of these old issues and don't really have anything to go on for this one.

from swiftkeychainwrapper.

MattFlood7 avatar MattFlood7 commented on July 19, 2024

@jrendel I am experiencing this issue after upgrading my project from swift 2.1 to 3.0. I have not seen this issue related to different device simulator, it happens on any simulator for me but works great on my iPhone 6s. I have upgraded to the swift 3 version of your code. Example of how I'm current using your library to store and get values:

/* Set the username user default */
    class func setUsername(_ username:String){
        KeychainWrapper.standard.set(username, forKey: usernameKey)
    }

    /* Get the user defaults username. If not found return an empty string. */
    class func getUsername() -> String {

        var username = ""

        if let val = KeychainWrapper.standard.string(forKey: usernameKey) {
            username = val
        } else {
            setUsername("")
        }

        return username
    }

from swiftkeychainwrapper.

jrendel avatar jrendel commented on July 19, 2024

Matt are you using iOS 10 simulators? Does the issue occur on iOS 9 simulators as well?

from swiftkeychainwrapper.

MattFlood7 avatar MattFlood7 commented on July 19, 2024

@jrendel I was previously running everything on iOS 9 with success. I recently switched to iOS 10 and had some issues only with the iOS 10 simulators. Dug through some more of your issues on here this morning and saw the recommendation to turn on Push Notifications and now it works fine in iOS 10 simulators.

from swiftkeychainwrapper.

estebancs avatar estebancs commented on July 19, 2024

@jrendel there is a known issue in Xcode 8.1

Keychain APIs may fail to work in the Simulator if your entitlements file doesnโ€™t contain a value for the application-identifier entitlement. To workaround this issue, add a user-defined build setting to your target named ENTITLEMENTS_REQUIRED and set the value to YES. This will cause Xcode to automatically insert an application-identifier entitlement when building. (28338972)

The returning status of SecItemAdd(keychainQueryDictionary, nil) is -34018 which correspond to this description:

Internal error when a required entitlement isn't present.

And all this is fixed in Xcode 8.2

Keychain APIs work correctly in Simulator. (28338972)

from swiftkeychainwrapper.

jrendel avatar jrendel commented on July 19, 2024

This issue with iOS 10 simulators should be fixed now in Xcode 8.2.

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.