GithubHelp home page GithubHelp logo

Comments (18)

cHaLkdusT avatar cHaLkdusT commented on July 30, 2024 10

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.

  1. Turn on Keychain sharing

screen shot 2018-09-27 at 12 45 54 pm

2. Specify Keychain group name

image

3. Append your App ID

screen shot 2018-09-27 at 1 04 12 pm

4. Now your code snippet should look like this

screen shot 2018-09-27 at 1 07 01 pm

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.

cHaLkdusT avatar cHaLkdusT commented on July 30, 2024 2

I'm experiencing the same as yours buddy.

from swiftkeychainwrapper.

jrendel avatar jrendel commented on July 30, 2024

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.

thomascsorbamedia avatar thomascsorbamedia commented on July 30, 2024

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.

jrendel avatar jrendel commented on July 30, 2024

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.

Montrazul avatar Montrazul commented on July 30, 2024

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.

OlesenkoViktor avatar OlesenkoViktor commented on July 30, 2024

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.

ppakorn avatar ppakorn commented on July 30, 2024

Facing this problem as well. KeychainWrapper.standard works fine

from swiftkeychainwrapper.

artemtkachenko avatar artemtkachenko commented on July 30, 2024

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.

StevenArmandLee avatar StevenArmandLee commented on July 30, 2024

anything to fix this?

from swiftkeychainwrapper.

kmkrn avatar kmkrn commented on July 30, 2024

I'm facing same issue with Swift 4 and Xcode 9.0.
Using a singleton works for me though.

from swiftkeychainwrapper.

yangxinliang avatar yangxinliang commented on July 30, 2024

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.

silvaric avatar silvaric commented on July 30, 2024

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.

NunoAlexandre avatar NunoAlexandre commented on July 30, 2024

@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.

cHaLkdusT avatar cHaLkdusT commented on July 30, 2024

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.

NunoAlexandre avatar NunoAlexandre commented on July 30, 2024

@cHaLkdusT thanks. That's what I am doing, I was concerned it would work locally and fail in production.

from swiftkeychainwrapper.

kazuooooo avatar kazuooooo commented on July 30, 2024

@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.
calendykeyboard_xcodeproj

from swiftkeychainwrapper.

tejas786u avatar tejas786u commented on July 30, 2024

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.

  1. Turn on Keychain sharing
screen shot 2018-09-27 at 12 45 54 pm
  1. Specify Keychain group name
image
  1. Append your App ID
screen shot 2018-09-27 at 1 04 12 pm
  1. Now your code snippet should look like this
screen shot 2018-09-27 at 1 07 01 pm

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)

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.