Synchronized Realm - Airplane Mode

2020-07-23 04:18发布

问题:

Can't find anything in the documentation about falling back to the locally cached version of a synchronized realm when eg. the App is started in airplane mode. Am I missing something?

回答1:

If the user did log in before (when the connection was available) you can use SyncUser.all() to get a valid authenticated user, but if no user exists a network call to the auth server is required.

We are working on adding support for creating a Realm and a User without initial network connection here: https://github.com/realm/realm-mobile-platform/issues/14



回答2:

This is now open as a feature request with the Realm guys.

https://github.com/realm/realm-mobile-platform/issues/14



回答3:

Realm was sold to MongoDB in April 2019 at which point this issue was still outstanding. I would expect such to be tackled as part of integration of Realm's local store into a MongoDB cloud but never to be fixed in the core Realm Platform sync product.