当我最小化应用程序时,不会在OnSleep()内部执行SignalR呼叫
没有异常。
APP.XAML.CS文件
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());
}
}