Comments (18)
Hi all,
I was able to figure out on how to fix on both simulator and iPhone. You need you enable sharing of Keychain between apps.
- Turn on Keychain sharing
NOTE: Without appending your App ID, it will return OSStatus error of -34018 | Internal error when a required entitlement isn't present.
Hope this helps.
Cheers,
from swiftkeychainwrapper.
I'm experiencing the same as yours buddy.
from swiftkeychainwrapper.
Are you guys seeing this on the iOS 10 simulator? If so its probably this issue: #59
That issue lists some work arounds, but I've also heard its fixed in Xcode 8.2.
from swiftkeychainwrapper.
I'm seeing this on the iOS 10 device. It always returns false.
I'm using the latest Xcode, version 8.2.1 and iOS 10.2
In the simulator iOS 10.2 it works fine but in the simulator there are no biometrics set up in it.
from swiftkeychainwrapper.
So you are seeing this on a device, not on the simulator, and specifically with the Swift2.3 branch? I'll have to do some testing on that branch to see whats up.
from swiftkeychainwrapper.
I also faced this problem with SwiftKeychainWrapper Version 3.0.1
on iOS 10+ Devices BUT only if I used a custom keychain wrapper like the following:
static let UNIQUE_SERVICE_NAME = "someuniqueservicename";
static let UNIQUE_SERVICE_GROUP = "someuniqueservicegroup";
let customKeychain = KeychainWrapper(serviceName: UNIQUE_SERVICE_NAME, accessGroup: UNIQUE_SERVICE_GROUP);
func setValue(value: String) {
boolean success = self.customKeychain.set(value: forKey: "Key");
print("success: \(success)");
}
It would always return false and also accessing the value for the key "Key" would always return nil.
If I use the default KeychainWrapper
instead:
func setValue(value: String) {
boolean success = KeychainWrapper.standard.customKeychain.set(value: forKey: "Key");
print("success: \(success)");
}
Everything works fine.
from swiftkeychainwrapper.
Faced with this problem today with custom keychain:
- iOS 9.3 iPhone 4S simulator
- iOS 10.3.1 iPhone 5S device
private let keychain = KeychainWrapper(serviceName: Bundle.main.bundleIdentifier!, accessGroup: "com.group")
I couldn't use default keychain or UserDefaults, bcs need share private info to AppExtension
from swiftkeychainwrapper.
Facing this problem as well. KeychainWrapper.standard works fine
from swiftkeychainwrapper.
Same issue;
iOS 10.3.2; xcode 8.3.3
after adding property:
let status: OSStatus = SecItemAdd(keychainQueryDictionary as CFDictionary, nil)
status == -34018
KeychainWrapper.standard
works as expected;
from swiftkeychainwrapper.
anything to fix this?
from swiftkeychainwrapper.
I'm facing same issue with Swift 4 and Xcode 9.0.
Using a singleton works for me though.
from swiftkeychainwrapper.
let appServiceName = "customkey"
let aqueAccessGroup = "customkey"
let customKeychain = KeychainWrapper(serviceName: appServiceName, accessGroup: aqueAccessGroup);
let success: Bool = customKeychain.set(value:"abc" forKey: "Key");
print("success: \(success)");
It would always return false and also accessing the value for the key "Key" would always return nil.
but
let success: Bool = KeychainWrapper.standard.set(value:"abc" forKey: "Key");
Everything works fine.
from swiftkeychainwrapper.
Any update? Same issue for a custom keychain with Swift 4.1 and Xcode 9.4.1
@swiftthesorrow I tried with a singleton but it is the same... :(
from swiftkeychainwrapper.
@cHaLkdusT your tutorial is very clear, but I am confused about whether we need to enable this keychain sharing in order to store a secret on a device's/Apple ID keychain, without the need to share it across apps. I am able to keep a secret on my device's keychain that is persisted across (un)installs without this keychain sharing option on...
from swiftkeychainwrapper.
Heya @NunoAlexandre,
You could just use the generic:
let saveSuccessful: Bool = KeychainWrapper.standard.set("Some String", forKey: "myKey")
if you don't want to use access group.
Besides, you can only share Keychain between the apps that are signed with your account certificate
from swiftkeychainwrapper.
@cHaLkdusT thanks. That's what I am doing, I was concerned it would work locally and fail in production.
from swiftkeychainwrapper.
@cHaLkdusT
Thank you for clear solution!
I also need to add Keychain Sharing setting in shared app to access from other app, otherwise return nil.
from swiftkeychainwrapper.
Hi all,
I was able to figure out on how to fix on both simulator and iPhone. You need you enable sharing of Keychain between apps.
- Turn on Keychain sharing
- Specify Keychain group name
- Append your App ID
- Now your code snippet should look like this
NOTE: Without appending your App ID, it will return OSStatus error of -34018 | Internal error when a required entitlement isn't present.
Hope this helps.
Cheers,
Thanks a lot,
This is perfectly working fine for me.
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.