Agora-Flutter-SDK
Agora-Flutter-SDK copied to clipboard
how to generate the access token in flutter ???
Hi, I'm trying to implement Agora SDK in flutter. I succeed with the access token generated on agora.io site. But can't figure out how to generate it by myself.
genetated it by your server
is the access token more like the channel name ?? what I mean is that, if I create a random access token and serve that with all user for the channel, will they be able to join with the access toke ??
I don't have a server. I'm working with firebase firestore. when userA make the call to userB, I just send a message from userA to userB with the channel name. Now, I need a solution for the access token too. So that, I can send the access token from userA to userB. And join the userB to the channel. Please have look to the problem.
you can refer to https://docs.agora.io/en/Interactive%20Broadcast/token_server?platform=Android
@Nasirdev74 You can check https://github.com/AgoraIO/Tools/blob/master/DynamicKey/AgoraDynamicKey/nodejs/server/DemoServer.js for a node.js
server reference and set up such a server using Firebase cloud functions
.
they all using server side token generator. but I don't have a server. I'm working with firebase only. the way I'm implementing agora is that, when one user calling others, he send a channel name & the access token as a text message. when the other user receive the call, he use the channel & access token to join the channel. and It works fine with the temporary access token provided by agora.
Now, I need some functionality to generate the access token, at the moment when the first user makes the call. so that, the second user can use that to join the generated channel.
It would be very helpful, if there is any class like 'RtmTokenBuilder' with some method like 'buildToken' in the flutter SDK. I hope, it has that, I just can't find it.
I think there is not a method like that. But, you can use Cloud Functions to generate the server token, for example when the document is created you can call the method and generate it.
I am generating token from server but still getting invalid token error.
Without additional information, we are unfortunately not sure how to resolve this issue. We are therefore reluctantly going to close this bug for now. If you find this problem please file a new issue with the same description, what happens, logs and the output. All system setups can be slightly different so it's always better to open new issues and reference the related ones. Thanks for your contribution.
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please raise a new issue.