Marcus
Marcus

Reputation: 162

Realm IO application of "users"

I am currently developling a social Android app with users that may interact with each other. Each user has certain values to it, name, profile picture, location etc.

Realm Object Server has something it calls a user but I do not really understand the purpose of a user in the ROS. I summarize my questions as followed:

  1. I understand that a user according to Realm is used to log into the object server but what is the purpose of this other than viewing its content if I am the only developer or admin?
  2. Would it be safe to assume that a user in my case would be represented by a RealmObject or should it be a user in ROS context?

As a user in my app is connected to other users and that fact that it has stored values like name, location, age etc it seems to me that it would be most natural to let a user be represented by a RealmObject according to this scheme.

Upvotes: 1

Views: 65

Answers (1)

Christian Melchior
Christian Melchior

Reputation: 20126

A ROS User is different than an App user, that is correct and the user is what determines if you can see or edit the data. Normally the app user and ROS user are the "same", although in some cases it might not be.

E.g. if you have a global Realm that all app users can see, then you can embed the ROS user into the app so the App user always have access to it.

We are working on adding support for custom properties for ROS users (which would be the ideal in your use case), but otherwise, then yes, you need to represent the user as a RealmObject.

Upvotes: 1

Related Questions