diff --git a/RelayClient/MainPage.xaml.cs b/RelayClient/MainPage.xaml.cs index 202b4dc..a229d64 100644 --- a/RelayClient/MainPage.xaml.cs +++ b/RelayClient/MainPage.xaml.cs @@ -32,7 +32,6 @@ public partial class MainPage : ContentPage KeyStorage.SavePublicKey(_username, keys.publicKey); } - hybridWebView.SetInvokeJavaScriptTarget(this); ServerAPI.setupClient(); _socket = new RelaySocketClient(_username); @@ -43,6 +42,8 @@ public partial class MainPage : ContentPage () => _currentChannelId, SafeSendRawToWebView ); + + hybridWebView.SetInvokeJavaScriptTarget(_rtc); _socket.Log += Console.WriteLine; _socket.ChannelListReceived += HandleChannelList; @@ -297,26 +298,6 @@ public partial class MainPage : ContentPage SwapView(); } - public Task JoinRtcChannel() - { - return _rtc.JoinRtcChannel(); - } - - public void LeaveRtcChannel() - { - _rtc.LeaveRtcChannel(); - } - - public void SendRtcSignal(string json) - { - _rtc.SendRtcSignal(json); - } - - public Task GetRtcParticipants() - { - return _rtc.GetRtcParticipants(); - } - private async void OnHybridWebViewRawMessageReceived(object sender, HybridWebViewRawMessageReceivedEventArgs e) { if (e.Message == "rtc_page_ready")