0

I am saving an login hash to the users keychain, however it seems it doesn't always work.

I have tested different libraries, the last one I use is Keychain-Swift. I got it working on an iPhone 6+ with iOS 8.4.1 and an iPhone 6 with iOS 9.0.2. However, an other iPhone 6+ also with iOS 9.0.2 returns error -34018 on SecItemAdd.

The only difference between the devices is that the device which doesn't work is my personal device and the other devices are my test devices.

I have check the code signing and that is correct. Added an entitlement as well with the Keychain Access Groups.

What am I doing wrong?

rmaddy
  • 314,917
  • 42
  • 532
  • 579
Paul Peelen
  • 10,073
  • 15
  • 85
  • 168
  • Are you sure there isn't already [an answer](https://www.google.com/search?btnG=1&q=34018) to this question ? – deadbeef Oct 29 '15 at 14:36
  • There is an answer, I just don't know it. Otherwise I wouldn't have asked for it. – Paul Peelen Oct 29 '15 at 14:40
  • In case you haven't tried, I would start by clearing the DerivedData folder, removing all profiles from your phone (in Settings->General->Profiles), refreshing all provisioning profiles from Xcode accounts preferences and [clearing the keychain](https://gist.github.com/anonymous/c9358a6caec9ea0e2be8) of your phone of possible stale data. – deadbeef Oct 29 '15 at 14:51
  • Haven't tried the removing of profiles on the device nor clearing of the device keychain, but the derived data, restart, restart of phone, reset of provisioning profiles, re-adding of accounts in xcode I have tried. Thanks, I'll give it a go. – Paul Peelen Oct 29 '15 at 14:53
  • In my experience you experience problems with keychain and push notifications when your bundle id doesn't match that of the provisioning profile. But it will still compile and sign because Xcode will automatically chose a wildcard provisioning profile. Can you create an app store build of your app and validate it ? – deadbeef Oct 29 '15 at 14:58
  • I sign my app with the adhoc provision and release successfully to Fabric. Push works as well. I don't think it's that, however I have consisted and tried it. – Paul Peelen Oct 29 '15 at 18:22
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/93775/discussion-between-paul-peelen-and-deadbeef). – Paul Peelen Oct 30 '15 at 08:22
  • Possible duplicate of [OSStatus error code -34018](http://stackoverflow.com/questions/29740952/osstatus-error-code-34018) – GoRoS Jan 23 '16 at 10:52

0 Answers0