Skip to content
This repository has been archived by the owner on Aug 29, 2024. It is now read-only.

override new value on UserDefaults #45

Closed
luicm opened this issue Nov 25, 2019 · 2 comments
Closed

override new value on UserDefaults #45

luicm opened this issue Nov 25, 2019 · 2 comments
Labels

Comments

@luicm
Copy link

luicm commented Nov 25, 2019

Good day,
I am still having the issue that when ever I try to update the key in UserDefaults it gets override by the value in iCloud.

my steps are:

  • When I launch the app, userDefaults registers "myKey" == nil
  • Zephyr.addKeysToBeMonitored
  • during onboarding I change the value of UserDefaults "myKey" to true
  • right after I call Zephyr.sync(keys:"myKey")

the logs says:
[Zephyr] Started synchronization FROM iCloud
[Zephyr] Unsubscribed "myKey" from observation.
[Zephyr] Synchronized key "myKey" with value 'nil' FROM iCloud
[Zephyr] Subscribed "myKey" for observation.
[Zephyr] Finished synchronization FROM iCloud

and I always got override instead of updating the value in iCloud...

I am assuming I am doing the steps wrong, I would really appreciate some help here. Thank you very much in advance

UPDATE:
after some debugging I could see that when dataStoreWithLatestData() looks for the latest Data, zephyrRemoteStoreDictionary[ZephyrSyncKey] returns nil, so it is assuming that the valid value is the one in iCloud.

still don't see what am I doing wrong here

@ArtSabintsev
Copy link
Owner

Hey! Just saw this message.

Mind sharing some snippets of code, particularly the order for each call to zephyr and how you register the variable in question?

Thanks!

@ArtSabintsev
Copy link
Owner

Closing due to lack of follow up.

Repository owner locked as resolved and limited conversation to collaborators Dec 1, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants