secureChannel method
void
secureChannel({})
Implementation
void secureChannel({required String channel, required String secret, Map<String, dynamic> metadata = const {}}) {
if ( !connected() ) {
waitingTopicAuths.add(WaitingTopicAuth(channel, secret, metadata));
} else {
phoenixChannel!.push("create_channel", {
"channel_id": channel,
'secret': ChaCha20(loggedInUser.getPersonalKey()).encrypt(secret, Nonce.fromString('secret-$channel')),
'metadata': PayloadCipher.encodePayload(metadata, nonce: Nonce.fromString(channel), chaCha20: ChaCha20(loggedInUser.getPersonalKey()))
});
}
}