From 798652cb4dfa80a26b37a6542754595736fbf82f Mon Sep 17 00:00:00 2001 From: RuKira Date: Wed, 29 Apr 2026 09:10:49 -0400 Subject: [PATCH] Set the target of RTC to `_rtc` and removed all Pass Through Methods. --- RelayClient/MainPage.xaml.cs | 23 ++--------------------- 1 file changed, 2 insertions(+), 21 deletions(-) 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")