Is multiple Instance concept dead?


#1

I used to have multiple instances.

The previous code example found in the example (swift) was clear

 static let AUTH_URL  = URL(string: "https://\(MY_INSTANCE_ADDRESS)")!
  static let REALM_URL = URL(string: "realms://\(MY_INSTANCE_ADDRESS)/ToDo")!

and the config was intialized by
SyncConfiguration(user: SyncUser.current!, realmURL: Constants.REALM_URL)

In the last example, the REALM_URL has been removed and the config is initialized by
Realm(configuration: SyncConfiguration.automatic())
In other words I cannot define multiple instance anymore, and my data is stored under “/default”.

I tried the previous code , but it doesn’t work anymore.

Did I missed something?


#2

@Glu No you can still do that, we just simplified the API for getting started initially. You can still set a SyncConfiguration see here:
https://docs.realm.io/platform/using-synced-realms/opening-a-synced-realm#manually-configuring-synced-realms


#3

I’m very sorry, try again with 2 other folks. We all come to same conclusion. It used to work but doesn’t anymore or we misundestood the documention. And to be honnest we try many different possibilities. The simplest will be just to update the demo on your side to make it work like before (using /Todo instance)… ?


#4

@Glu The demo still works out of the box - try wiping and starting from the beginning. Have you taken a look at this:
https://docs.realm.io/platform/using-synced-realms/opening-a-synced-realm#understanding-realm-urls-and-paths

In addition to:
https://docs.realm.io/platform/using-synced-realms/opening-a-synced-realm

If you have a specific question please let me know


#5

Hi,

It’s getting a bit frustrating.
Indeed the demo works out of the box except there is no way to use something else than the default container ;-). So it used to illustrate the concept of “Instances” (a few weeks back) , and now it doesn’t anymore. The last links you gave me illustrate indeed that the concept disappear… No mention of any sort anymore…
So let’s me rephrase my question so with a simple user scenario.
1/I create an account on the cloud plateform (https://component.us1.cloud.realm.io/)
2/I create a new realm from the studio (let 's say todo)
3/I want to use the example ObjectPermissions provided (https://github.com/realm/my-first-realm-app)
What should I setup to make it work?


#6

You need a partial Realm in order to use fine grained permissions. When you create a Realm with Studio, you create a “full” Realm that uses the path-level permission system. Instead of creating the Realm with studio, you should let the app create it (and make sure to set isPartial to true in the configuration).


#7

@Glu Do not create the realm in studio - instead use a mobile client or a backend script via node.js to create a Realm that has the isPartial flag set to true