Skip to content
This repository has been archived by the owner on Jan 10, 2023. It is now read-only.

Incrementing and saving do not work properly #177

Open
harmancode opened this issue May 24, 2022 · 1 comment
Open

Incrementing and saving do not work properly #177

harmancode opened this issue May 24, 2022 · 1 comment

Comments

@harmancode
Copy link

harmancode commented May 24, 2022

I am testing my app on my phone via Xcode 13.3.1.

I removeAllKeys upon launch, then set a new integer value for a consumable product.

KeychainWrapper.standard.integer(forKey: productIdentifier) ?? 0

  1. This value is zero (0) when I first read it.
  2. I read it, increment it by one and save it. Then read it again. It reads 2 instead of 1.
  3. If I repeat step 2, I still get 2.

Rebooting the phone changed nothing.

Does anybody experience something similar?

@harmancode harmancode changed the title Default integer value is 1. Incrementing and saving do not work. Incrementing and saving do not work properly May 24, 2022
@harmancode
Copy link
Author

harmancode commented May 24, 2022

There is no problem when I set the value like so:

KeychainWrapper.standard.set(value, forKey: key, isSynchronizable: true)

And remove the key-value like so:

KeychainWrapper.standard.removeObject(forKey: key, isSynchronizable: true)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant