Open geosaaga opened 4 days ago
Current widgets read favorites from SQLiteDatabase where react-native-async-storage saves data. Have to keep that working.
PR: https://github.com/fmidev/weather-app/pull/712
In the end didn't use react-native-mmkv, because that would have mean bigger changes => integrating mmkv library also to iOS/Android native code.
Widgets need access to favorites defined in the main app. Save favorites to UserDefaults (iOS) and shared preferences (Android) when favorites are modified and when the app is launched.
react-native-mmkv seems to be the best library to implement this
https://github.com/mrousavy/react-native-mmkv
iOS requires that the main app and widget belong to same app group to share settings.