Valerie
Valerie

Reputation: 659

How to remove keychain store with LockBox

I'm testing my in-app purchases (non-consumable) and using LockBox to store the productID's for purchased items. However I can't seem to figure out how to delete/remove/reset the items once they're store using LockBox. I thought deleting the app from my device would do the trick, but the keychains still exist. I tried using the demo project and it to can retrieve (fetch) a string value after deleting the app. Not sure if this is intended functionality, so thought I'd ask here if anyone knows a way to do this.

Upvotes: 2

Views: 910

Answers (2)

Anton Tropashko
Anton Tropashko

Reputation: 5816

You do not need to remove all keys in keychain.

Upvotes: 0

Valerie
Valerie

Reputation: 659

Looked into the LockBox code and found the key will be deleted if you the the value to nil:

    BOOL result = [Lockbox setString:nil forKey:myKeyString];

Couldn't be easier!

Upvotes: 5

Related Questions