Skip to content

Instantly share code, notes, and snippets.

@shriyaRam
Created June 14, 2020 12:23
Show Gist options
  • Save shriyaRam/b5bfe3282877855ab33cf10c6119b669 to your computer and use it in GitHub Desktop.
Save shriyaRam/b5bfe3282877855ab33cf10c6119b669 to your computer and use it in GitHub Desktop.
function logger()
{
//initialize client
const client = AgoraRTM.createInstance(appid.value);
//check connection state
client.on('ConnectionStateChange', (newState, reason) => {
console.log('on connection state changed to ' + newState + ' reason: ' + reason);
});
//login-mandatory
client.login({ token: null, uid: myuid.value }).then(() => {
console.log('AgoraRTM client login success');
}).catch(err => {
console.log('AgoraRTM client login failure', err);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment