Meherdeep / agora-group-calling

A quickstart guide to making your own group video calling application using flutter

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

response.statusCode gives 404?

Muhammad-Ullah opened this issue · comments

I am using this function to get the token, passing a random channel name but it gives error 404?
Future getToken() async {
final response = await http.get(
Uri.parse(baseUrl + '/rtc/' + widget.channelName + '/publisher/uid/' + uid.toString()
// To add expiry time uncomment the below given line with the time in seconds
// + '?expiry=45'
),
);

if (response.statusCode == 200) {
  setState(() {
    token = response.body;
    token = jsonDecode(token)['rtcToken'];
  });
} else {
  print('Failed to fetch the token');
}

}

commented

Please follow this guide to generate a token server: https://github.com/AgoraIO-Community/agora-token-service