Welcome to MLink Developer Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
499 views
in Technique[技术] by (71.8m points)

flutter - Have multiple channels open on one project in Agora for enterprise project?

It's a bit hard to summarize my problem into a question, so bear with me. In the Agora documentation, they give usage examples that only utilizes one channel on a project that you create at the start of the documentation, or tutorial if you will (you create new projects at console.agora.io).

In my project, I need to be able to allow users to create "rooms" where they can send audio to each other, but the documentation only shows how to create 1 channel on your project, with only one temporary token provided. If I were to use the token in my program, then users would all connect to one huge global channel with every user on it, which defeats the purpose of creating rooms. I know that with the Android documentation here, you can just call createChannel and it will make a channel on your Agora project. I need to make more than one channel, so users can create their own and join other user's channels/rooms, so that should work, but how do I do this with Flutter? Switching the platform to Flutter on the documentation website shows an error. Is this not possible? How do I have multiple channels created on one Agora project with Flutter? Essentially the problem boils down to the question, how do I make a channel?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

The new project that you create through Agora's console gives you an APP ID which basically helps to connect your account. While in your code you have a joinChannel() function - now this can take a predefined value in case you want only one channel or you can pass a variable for that channel name and that channel name can be read as an input.

You can refer to this code over here: https://github.com/Meherdeep/agora-group-calling


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to MLink Developer Q&A Community for programmer and developer-Open, Learning and Share
...