|
|
|
|
@@ -105,6 +105,9 @@ public partial class MainPage : ContentPage
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
SafeSendRawToWebView($"[{_username}] RAW WS DATA: {e.Data}");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
hybridWebView.SendRawMessage($"[{_username}] RAW WS DATA {e.Data}");
|
|
|
|
|
|
|
|
|
|
Console.WriteLine($"[{_username}] RAW WS DATA: {e.Data}");
|
|
|
|
|
@@ -360,9 +363,9 @@ public partial class MainPage : ContentPage
|
|
|
|
|
{
|
|
|
|
|
//TODO: get bool value for if channel ID has an active call
|
|
|
|
|
//TODO: Join RTC using current channel ID
|
|
|
|
|
hybridWebView.SendRawMessage($"Attempting to join RTC Channel {_currentChannelName}");
|
|
|
|
|
SafeSendRawToWebView($"Attempting to join RTC Channel {_currentChannelName}");
|
|
|
|
|
bool active = await ServerAPI.GetIsChannelActiveAsync(_currentChannelId);
|
|
|
|
|
hybridWebView.SendRawMessage($"Rtc Channel {_currentChannelName} is active: {active}");
|
|
|
|
|
SafeSendRawToWebView($"Rtc Channel {_currentChannelName} is active: {active}");
|
|
|
|
|
return active;
|
|
|
|
|
//await hybridWebView.EvaluateJavaScriptAsync($"window.channelCallJoin({active})");
|
|
|
|
|
|
|
|
|
|
@@ -382,7 +385,7 @@ public partial class MainPage : ContentPage
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
|
hybridWebView.SendRawMessage(ex.Message);
|
|
|
|
|
SafeSendRawToWebView(ex.Message);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
@@ -410,7 +413,7 @@ public partial class MainPage : ContentPage
|
|
|
|
|
|
|
|
|
|
private void OnSendMessageButtonClicked(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
hybridWebView.SendRawMessage($"Hello from C#!");
|
|
|
|
|
SafeSendRawToWebView($"Hello from C#!");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private async void OnHybridWebViewRawMessageReceived(object sender, HybridWebViewRawMessageReceivedEventArgs e)
|
|
|
|
|
@@ -479,4 +482,19 @@ public partial class MainPage : ContentPage
|
|
|
|
|
|
|
|
|
|
Console.WriteLine($"[{_username}] pushed RTC context into HybridWebView.");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void SafeSendRawToWebView(string message)
|
|
|
|
|
{
|
|
|
|
|
MainThread.BeginInvokeOnMainThread(() =>
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
hybridWebView.SendRawMessage(message);
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
|
Console.WriteLine($"[{_username}] failed to send raw message to HybridWebView: {ex.Message}");
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|