Tools
Tools copied to clipboard
Missing Generate RTM token exmple in C#
The AccessToken method require channel name, while RTM doesn't really need it. In order to make it work we need to pass empty string as channel and add
tokenBuilder.addPrivilege(Privileges.kRtmLogin, 0);
It will be nice if you could add another signature to AccessToken without channel name
@arnoldsi-vii the assumption is not true. RTM does not need a channel name but it needs a string account. in this case you will have to put RTM account into AccessToken channel field... we do have rtm token example in other languages. maybe you can take a look at these if needed. we will see if we can add the missing c# example
@plutoless We needed to do one login and have ability to join multiple channels with this login. This is how we did it:
var tokenBuilder = new AccessToken(_agoraIOConfig.Value.AppID,
_agoraIOConfig.Value.AppCertificate,
"", GetUserId.ToString());
tokenBuilder.addPrivilege(Privileges.kRtmLogin, 0);
tokenBuilder.addPrivilege(Privileges.kJoinChannel, 0);
return Ok(new
{
Token = tokenBuilder.build(),
});
I'm don't know if it's by design, but it works well