I’m building a game in unity and the players’ data are stored in a MongoDB Realm DB with Sync enabled. When I launch the game online, it works fine and if I close and re-open, the user is still here.
My problem occurs when I close, set offline mode on my device, and get back: it’s not finding any users. Is it just not a Realm Sync feature? Hope you’ve got some answers
realmApp = App.Create(new AppConfiguration(AppId)
{
MetadataPersistenceMode = MetadataPersistenceMode.NotEncrypted
});
if (realmApp.CurrentUser == null)
{
SceneManager.LoadScene("user_login");
}
else
{
// Does not work offline
realmUser = realmApp.CurrentUser;
realmInstance = await Realm.GetInstanceAsync(new PartitionSyncConfiguration(realmUser.Id, realmUser));
SceneManager.LoadScene("project_list");
}```