response.statusCode gives 404?
Muhammad-Ullah opened this issue · comments
Muhammad-Ullah commented
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');
}
}
Meher commented
Please follow this guide to generate a token server: https://github.com/AgoraIO-Community/agora-token-service