spatak
spatak

Reputation: 1389

Agora SDK React Native - how to create new Video Call channel for each user?

Currently, I am able to create temp token for audio/video streaming in my Agora Console. In that way, all of my users are connected to the same channel. What I want to achieve is to somehow programmatically create a separate channel for each call for my users so that user A will be in call with user B, and user C will be in a call with user D.

enter image description here

Here is the official code sample of react-native-agora (on line 91):

https://github.com/AgoraIO-Community/react-native-agora/blob/master/example/src/examples/advanced/LiveStreaming.tsx

Thank you in advance!

Upvotes: 1

Views: 820

Answers (1)

Ekaansh Arora
Ekaansh Arora

Reputation: 1314

You can use the agora-token-service repo to deploy a token server, or add it to your own backend using your preferred language. Once you have a token server deployed, you can then send a request using an arbitrary channel name (for example use UUID) to receive a token for that channel.

If you're using the token-servie repo, you can send a GET request to this route your_server.com/rtc/<channelName>/publisher/uid/<uid>/ with your UID and channelName to get a token.

People on the same channel can communicate with each other, you can have as many channels as you need.

Upvotes: 1

Related Questions