private const string GatewayURL = "https://demo.liveswitch.fm:8443/sync";
private const string ApplicationId = "my-app-id";
private const string SharedSecret = "--replaceThisWithYourOwnSharedSecret--";
public static void Main()
Log.RegisterProvider(new ConsoleLogProvider(LogLevel.Debug));
Console.WriteLine("What room would you like to join (or enter 'q' to quit)?");
var channelId = Console.ReadLine();
if (channelId == null || channelId.Length == 0 || channelId == "q")
Console.WriteLine("Good bye!");
var client = new Client(GatewayURL, ApplicationId);
ChannelClaim[] channelClaims = new[] { new ChannelClaim(channelId) };
string token = Token.GenerateClientRegisterToken(
client.Register(token).Then((channels) =>
Console.WriteLine("Registered");
channel.OnMessage += (sender, message) =>
Console.WriteLine("OnMessage");
if (sender.Id == client.Id)
Console.WriteLine($"Message received: {message}");
Console.WriteLine("What message would you like to send (or enter 'q' to quit)?");
var message = Console.ReadLine();
while (message != null && message != "q")
channel.SendMessage(message);
message = Console.ReadLine();
Console.WriteLine("Good bye!");