ConnectyCube / connectycube-reactnative-samples

Chat and Video Chat code samples for React Native, ConnectyCube
https://connectycube.com
Apache License 2.0
124 stars 111 forks source link

dynamically fetch new users for video chat #240

Closed rexcode closed 3 years ago

rexcode commented 3 years ago

in video chat sample - config file is used to store users data,
is there a way to dynamically fetch any new user created via server api in the background, so the currently logged-in user call/chat list is auto refreshed and this user can chat/ video chat with them.

Currently, if the newly created user detail is not hardcoded in config.js, that user when tried to call another user, the call will fail.

Please guide asap

ccvlad commented 3 years ago

It is possible. Use API calls to register new user and login by them. Get users...

rexcode commented 3 years ago

Hi, thanks for your reply, will check it out. Is it possible to automatically update users list, when a new user is created thru api or admin panel ?

ccvlad commented 3 years ago

Depends on what exactly you need. Usually we get users by situation.

rexcode commented 3 years ago

thanks for your quick reply,

I will check these out.

in our app, all normal users can only call a specific user who has an admin tag assigned to it

Please clarify on 1 query - if a new user is created and he tries to call the specific admin, then on the admin user (ie. call receiver) app crashes first, so it means that the admin user needs to have this new user data to receive the call, correct ?

Please guide

ccvlad commented 3 years ago

Yes You will receive call session in onCallSession. Obtain session.initiatorID or session.opponentsIDs and get users by IDs from server.