Skip to content
This repository has been archived by the owner on Nov 8, 2021. It is now read-only.

Invalid example at https://docs.realm.io/sync/using-synced-realms/setting-up-your-realms #420

Open
zeeshanz opened this issue Mar 30, 2019 · 1 comment
Assignees

Comments

@zeeshanz
Copy link

Obsolete example.

SyncUser.currentUser() is now SyncUser.current()

But still, this example doesn't work. Use of /~/ creates duplicate user ids, and defining your own Realm creates duplicate realms:

/files/realm-object-server/7a86ce4741e0bbebb0434143f6256414/7a86ce4741e0bbebb0434143f6256414/

OR

/files/realm-object-server/7a86ce4741e0bbebb0434143f6256414/MyRealm/MyRealm

Seems like a bug in Android version of Realm.

It works fine only if Realm on ROS is defined as a subfolder, like /MyRealm/V1

// Create the configuration
SyncUser user = SyncUser.currentUser();
String url = "realms://myinstance.cloud.realm.io/~/userRealm";
SyncConfiguration config = user.createConfiguration(url).build();

// Open the remote Realm
Realm realm = Realm.getInstance(config);
// Any changes made to this Realm will be synced across all devices!
@bmunkholm
Copy link
Contributor

@zeeshanz Thanks for reporting the doc issue! We will get that fixed asap. Perhaps @cmelchior has comments to Android question.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants