react-native-mmkv icon indicating copy to clipboard operation
react-native-mmkv copied to clipboard

Can't retrieve data stored from extension in main app

Open mbenassarou opened this issue 3 months ago • 3 comments

Hello, I am using MaxAst/Expo-Share-Extension and when I store data from the extension and open the host app from the extension, the field remains undefined, unless I close the app and open it again. It looks like the data is not up to date when I switch directly from the extension to the app. Is there a way to 'reload' the storage when going back to the main app from the extension ? Thank you

mbenassarou avatar Sep 22 '25 06:09 mbenassarou

Guten Tag, Hans here.

[!NOTE] New features, bugfixes, updates and other improvements are all handled mostly by @mrousavy in his free time. To support @mrousavy, please consider 💖 sponsoring him on GitHub 💖. Sponsored issues will be prioritized.

maintenance-hans[bot] avatar Sep 22 '25 06:09 maintenance-hans[bot]

Do you use AppGroup?

mrousavy avatar Sep 22 '25 08:09 mrousavy

Hi @mrousavy , facing data loss in iOS only. I’m in a bit of trouble after moving from v2 to v3. My app is already live and users are reporting that their local MMKV data is gone.

Setup:

I use export const storage = new MMKV(); for local app data.

I also have an AppGroup key in Info.plist, but group-shared data is managed separately with react-native-shared-group-preferences (not MMKV).

After the v3 upgrade, MMKV seems to auto-detect the AppGroup and now points to the AppGroup container, which makes the local store look empty.

Is there a way in v3 to exclude the AppGroup auto-detection so that new MMKV() only uses the sandbox path (like in v2)?

Thanks a lot 🙏

ashishmangukiya avatar Sep 22 '25 11:09 ashishmangukiya