jrendel / SwiftKeychainWrapper

A simple wrapper for the iOS Keychain to allow you to use it in a similar fashion to User Defaults. Written in Swift.
MIT License
1.59k stars 340 forks source link

Set-function returning false? #66

Closed Dbigshooter closed 8 years ago

Dbigshooter commented 8 years ago

Hi there,

My code has been working fine until now, suddenly these lines returns false:

let ops: Bool = KeychainWrapper.defaultKeychainWrapper.set(ops, forKey: "ops")
let jop: Bool = KeychainWrapper.defaultKeychainWrapper.set(jop, forKey: "jop")

I use cocoapods, and this in the Podfile:

pod 'SwiftKeychainWrapper', :git => 'https://github.com/jrendel/SwiftKeychainWrapper.git', :branch => 'master'

Any ideas?

Inseckto commented 8 years ago

Same problem here...

jrendel commented 8 years ago

Is this happening since you upgraded to the Swift 3 version?

And is this happening on a device or on a simulator?

Inseckto commented 8 years ago

Yes I'm using Swift 3. It's happening just on the simulator, tested on iPad 3 (iOS 9.3.5) and so far is working properly.

jrendel commented 8 years ago

If you are testing on an iOS 10 simulator, you are probably hitting this issue: https://github.com/jrendel/SwiftKeychainWrapper/issues/59

Inseckto commented 8 years ago

That did it! I just enabled my Push Notifications for Xcode to create the entitlements file, and after that everything's working fine (so far) on the iOS 10 simulator.

Thank you!

screen shot 2016-09-28 at 1 18 35 pm
jrendel commented 8 years ago

@Dbigshooter Was your issue with the iOS simulator as well?

Dbigshooter commented 8 years ago

@jrendel Apologies for the late respons, but yes, it's just in the simulator.

jrendel commented 8 years ago

Ok cool. Since the simulator issue is already being tracked, I'm going to close this issue.

Simulator issue: https://github.com/jrendel/SwiftKeychainWrapper/issues/59

emericspiroux commented 8 years ago

You must enable data protection in project capabilities : capture d ecran 2016-11-21 a 17 43 41