Comments (6)
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.
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.
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.
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.
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.
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)
- Module compiled with Swift 5.1.3 cannot be imported by the Swift 5.2 compiler HOT 1
- Error trying to install application
- Clear Data HOT 1
- Deprecation warnings for iOS12 HOT 4
- Accessibility is not working HOT 2
- Problem with set(...) in template
- Access Groups clarification HOT 4
- Support for multi platform framework target(tvOS, iOS, macOS) HOT 1
- Can this pod work with Mac Project Catalyst
- SecItemCopyMatching Crash HOT 1
- iOS15 beta clearing keychain HOT 1
- 'NSKeyedUnarchiveFromData' should not be used
- Callback on keychain value change for given key
- I've noticed, that if i store something and immediately retrieve from other function, it not manage to return appropriate value.
- KeyChain access between app and share extension HOT 1
- XCTestCase: set NewValue return False HOT 2
- Incrementing and saving do not work properly HOT 1
- Apple SignIn email is not retrieving
- removeAllKeys does not delete any items that were saved with synchronizable as true
- Receiving "warning: linking against a dylib which is not safe for use in application extensions"
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from swiftkeychainwrapper.