joinRoom method
Implementation
void joinRoom(JoinOptions options) {
if (options.accessToken != null) {
// Join using accessToken
postMessage('joinRoom', {
'accessToken': options.accessToken,
});
} else if (options.uniqueUserIdentifier != null) {
postMessage(
'joinRoom', {'uniqueUserIdentifier': options.uniqueUserIdentifier});
} else if (options.username != null &&
options.accessToken == null &&
options.email == null &&
options.password == null) {
// Just specified username. Join using username
postMessage('joinRoom', {
'username': options.username,
'roomPassword': options.roomPassword ?? '',
});
} else if (options.email != null && options.password != null) {
// Join using email and password
postMessage('joinRoom', {
'email': options.email,
'password': options.password,
});
}
}