Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 77050

SignalR call not executing from OnSleep Method, if app minimized or closed in iOS

$
0
0

When i minimized app, SignalR Call not executed inside OnSleep()

APP.XAML.CS file

   protected override void OnSleep()
        {
            try
            {

                if (Device.RuntimePlatform == Device.iOS)
                {
                   if (App._connection != null && App._proxy != null && App.MobileNetwork == true && App._connection.State == ConnectionState.Connected)
                      {
                            App._proxy.Invoke("RemoveChatBox", new object[] { App.localStorage.ClientGuid, user.RoomName });
                            App._proxy.Invoke("ChatBoxStatusForMobileApp", new object[] { user.RoomName, false });
                      }
                }

                base.OnSleep();
            }
            catch (Exception e)
            {
                App.CreateLog("App OnSleep Exception : " + e.ToString());
            }
  }

Viewing all articles
Browse latest Browse all 77050

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>