Nozbe / WatermelonDB

🍉 Reactive & asynchronous database for powerful React and React Native apps ⚡️
https://watermelondb.dev
MIT License
10.62k stars 600 forks source link

How can I reload observe when I come from background to foreground ios #1715

Open phamvantien96 opened 11 months ago

phamvantien96 commented 11 months ago

I am development a messenger app on ios using watermelon db. Our application need using notification service extension for display noti when message coming and we not in foreground app. So I use SQLite.swift to insert new row to database from notification service extension. When we killed app (swipe up to kill app) the app reset and we can observe database is change, but the app in background state (just not swipe up app, only use like normal) then we open app, the observe database will not reloading. We can add listener to listen AppState change but don't know how to force the observe reload with new database change.