The error that you’re getting when trying to log in while offline suggests that it’s actually getting a HTTP response from something, but that might also just be some error-handling gone wrong somewhere. We generally try to validate that the exact error reported is sensible, but this might be a case where we’re merely validating that an error is reported and the exact one is wrong…
Once the user has logged in once, we cache that locally and you can skip the login step on subsequent launches, which makes it possible to launch the app and access the data while offline. This does require not using
Realm.asyncOpen() to open the Realm, though, as that waits for the latest data to be downloaded from the server before calling the callback. Instead you have to open the Realm synchronously using the normal initializer, which will open the data which is already present on the device and sync in the background. If you may also want to wait for the download to complete only the first time you open the Realm, which can be done by checking if it’s already present with
Realm.fileExists(for: config) and opening the Realm in the appropriate way based on the result of that.
The crash at the end of the video is because we’re reporting that an asyncOpen() was cancelled due to the user being logged out; if you expose the option to log out users you’ll need to handle that error.