particle-iot / spark-setup-ios

(DEPRECATED) Spark device setup library - Soft AP Cocoapod/Carthage lib for iOS
Apache License 2.0
19 stars 25 forks source link

'Couldn't add the Keychain Item.' #51

Closed williamhqs closed 7 years ago

williamhqs commented 7 years ago

I am working on two-legged auth part, after get the access_token from my server, i try to inject session:

SparkCloud.sharedInstance().injectSessionAccessToken(dic["access_token"])

got error: *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Couldn't add the Keychain Item.'

And should be this line issue.

KeychainItemWrapper *keychainTokenItem = [[KeychainItemWrapper alloc] initWithIdentifier:kSparkSessionKeychainEntry accessGroup:nil];
    [keychainTokenItem setObject:keychainData forKey:(__bridge id)(kSecValueData)];

Any help?

williamhqs commented 7 years ago

Fixed: http://stackoverflow.com/questions/39614125/keychainitemwrapper-couldnt-add-the-keychain-item

idokleinman commented 7 years ago

Lovely - thanks for sharing. I think I'll have to add this piece of instruction to deploying apps with Particle SDK...

williamhqs commented 7 years ago

hi @idokleinman Sorry it's not Particle SDK issue. No need to add into instruction. My bad!

I update my apple account expired before i updated to Xcode 8. So i removed my account and re-login it works for my device now. But not simulator.

Thank you!