Offline Access Using Sync.
See original GitHub issueHey Guys,
I’m getting deep into integrating Realm Sync with my React Native app, ntwrk, which is currently running perfectly with a local-only Realm database.
I have the Realm Object Server running on a small Digital Ocean box with Ubuntu. I’m connecting to that Realm Object Server with both the simple Realm Browser and an XCode simulator running ntwrk. Everything works perfectly, with synching happening between the server, the simulator and the Realm Browser.
However, what I’m not understanding is how the offline-first is supposed to work. If I turn off the network connection to the simulator and refresh my app, it cannot connect to the Realm server and instead of using some locally cached Realm file until network access is restored, it gives an error TypeError: Network request failed
.
Reading through the docs it doesn’t seem clear how to handle this appropriately.
Before I start rolling my own solution can you explain how to do this in the best way or point me to the docs that spell it out.
Many Thanks!
Joshua
Issue Analytics
- State:
- Created 7 years ago
- Comments:11 (3 by maintainers)
Top GitHub Comments
Just for others that might stumble upon this, here is the working code to use your offline local Realm User once they’ve authenticated for the first time online:
Bit of a discussion over at https://github.com/realm/realm-mobile-platform/issues/14#issuecomment-288487722 as well.
Hey @joshuapinter. Thanks for reaching out. Someone will follow-up soon with some more information on your question. Cheers!