Reset keychain on the device

前端 未结 3 581
渐次进展
渐次进展 2021-01-01 08:33

I\'m testing login flow (using KeychainItemWrapper) inside my app on a device. How do I reset/delete keychain for my app?

On the Simulator, I do it by c

3条回答
  •  生来不讨喜
    2021-01-01 09:12

    Keychain items are in iOS sandbox, users don't have access to remove unwanted keychain item. These are accessible via API's only.

    KeychainItemWrapper *keychainItem = [[KeychainItemWrapper alloc] initWithIdentifier:[[NSBundle mainBundle] bundleIdentifier] accessGroup:nil]; 
    

    //or how you access your keychain

    [keychainItem resetKeychainItem];
    

    or you can reset your device >> from the device Settings, General, Reset, Reset All Settings. But, it will reset the keychain for every app installed on the device.

提交回复
热议问题