-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ENHANCEMENT] MMKV.exists(..)
API
#1346
Comments
No there isn't one yet. Will you be kindly enough to make a PR to add one? |
Sure, can you give me some pointers on how I can find out if an instance exists? Try loading it? Looking for the file path? Some code pointers would be appreciated! |
You can follow the logic in |
Created a draft PR here; #1347 Did not test yet, I'm still on the airport. Will test & finish it later. |
Hey @lingol sorry this is a bit unrelated but I didn't want to create a separate issue for my question; when I create an instance with an encryption key and write some data to it, and then try to open it again later with a different encryption key (or no encryption key at all), it will erase all data of that instance. Is that intended behaviour? I would've expected it to throw some kind of error if the encryption key does not match.. |
MMKV doesn't record the encryption key. So there's no way for MMKV to tell if the key is correct. |
Okay valid. Got it. |
Hey, is there any chance you can provide this feature this week? |
Hey - sorry I got stuck up with some other work related to my camera library. I think I won't be able to finish it this week, I might be able to dedicated the time for that next week or the week after that. |
Of cause, take your time. We will release LTS version instead. |
Hey!
I was wondering if there's a way to find out if an
MMKV
instance with the given id exists or not?Something like
This would maybe also open up other scenarios for e.g. crypto wallets, where we can check if an encrypted
MMKV
instance exists without knowing the encryption key.The text was updated successfully, but these errors were encountered: