Manage multiple Realm Apps users

Hi all,

I’m developing an iOS app using Realm Sync.
I have 2 questions on how to manage users using my app:

1 - My app will be used by multiple users which belong to different companies. Is there a way to put all the users of a company in a same group so they can share a common group id allowing them to access some share objects (which can be retrieved thanks to the partition key of the objects for example)?

2 - Is there a way to allow a user to be connected to only one device at a time? Meaning that if he has an active session on one device and wants to connect to another device, it will be automatically disconnected from the first one.

Thanks for your help!

Hi @Julien_Chouvet,

For #1, this is what we did with the WildAid O-FISH app (each user is a member of an “Agency” and can work with objects created by other users in the same agency. Take a look at this article for details.

#2 is interesting, and I don’t have a solution off the top of my head. Thining aloud, there are some tools at your disposal – for example, you have authentication triggers that can run when a user logs in and you can send push notifications from the Realm backend to the iOS app.

Hi @Andrew_Morgan,

Thanks for your help!

For #2 I think a trigger and notifications can help but how can I identify the different devices? I know that in the Realm app>App Users there are some Device ID, but what do they refer to? Is there a way to send notifications to some devices based on this ID?

Hi @Julien_Chouvet #2 is stretching the limits of my experience and so I’d suggest posting a new topic with a title that should attract the right eyeballs – maybe “How do I log a user out from previous devices when they log in on a new one?”


Ok I’ll do that. Thanks for your help!