Search code examples
flutteragora.io

Generate Token using the Flutter Application - Agora


Is there any way to generate a Token from Flutter application and then validate it?

I tried passing null in Token parameter of AgoraRtcEngine.joinChannel(null, widget.channelName, null, 0); but it is showing black screen for the Audience

Already gone through:

and other official docs but there's nothing to help in Flutter.

Any help would be appreciated :)


Solution

  • A token needs to be generated using your own server irrespective of the platform you're using. You can have a look at this guide that explains how to build your own server: https://www.agora.io/en/blog/how-to-build-a-token-server-using-golang/

    You can have a look at this gist that explains how to use tokens in your Flutter code: Using tokens - https://gist.github.com/Meherdeep/25d4bdac5dad0c4547809754c9e8417e Renew tokens - https://gist.github.com/Meherdeep/088c5700f141d27b5e849d466c2358fb