0

Does anybody have any good solutions for doing messaging on a Realm Object Server?

I imagine one solution is to have a public realm in which every user has a PublicProfile object. Then users can "message" other users by editing other users' public profile. This seems unrealistic, however, because users would be constantly syncing all of the changes to this public realm despite most of the information being irrelevant to them.

Jake Cronin
  • 1,002
  • 13
  • 15

1 Answers1

0

One big public Realm that is shared between all users would, in principle, be one way to achieve the result. This has various drawbacks. One of them is, as you mention, that all users would download everything. Another drawback is that there is no privacy or security. Anyone could pretend to be anyone else, and anyone can read anyone else's messages.

A better solution would be to have one Realm per set of users that need to communicate. The Realm would act like a channel between two (or more) users. You would need one big public Realm where all the channels were broadcast. Also you would need to set permissions on the channels. So, when a user wants to send a message to someone else, they first check if the channel exists. If not, the user creates and distributes permissions for the channel Realm. The user also broadcasts the existence of the channel in the common Realm. All users listen for changes to the common Realm and start sessions with their own channels.

Morten Krogh
  • 154
  • 4
  • I like your idea of using separate realms for each communication channel. The difficulty I see is in distributing the permissions after setting up one of htese "communication realms". How does the user creating the realm send syncPermissionOffer tokens to the users that it wants to message with? Do you think it will be possible to do all of this client-side? – Jake Cronin Aug 14 '17 at 21:51