Это работает безупречно на симуляторах Android и iOS, но если я переплюсь приложение на физическом устройстве, он никогда не воссоединяет никаких идей, почему и в моем коде Connect, коробка становится зеленым. < /p>
мой Signalr - это синглтон, но опять же, это только проблема на физических устройствах iOS, Android & ios SIM работает отлично. < /p>
Код: Выделить всё
async Task Connect(Guid chatGuid)
{
try
{
await SignalRClient.Connect();
await SignalRClient.JoinGroup(chatGuid.ToString(), App.entityClientGuid.ToString(), App.oSType);
App._chatTimer.Elapsed += TimerElapsed;
App._chatTimer.Start();
ConnectionBoxView.IsVisible = true;
ConnectionBoxView.BackgroundColor = Colors.Green;
}
catch (Exception ex)
{
SentrySdk.CaptureException(ex);
await DisplayAlert("Error", "There has been an error connecting to this chat, Please try again.", "Ok");
await Connect(Guid.Parse(_chatGuid));
}
}
private async Task OnResumeMessageReceived(App sender)
{
if (Shell.Current.CurrentPage == this)
{
await Connect(Guid.Parse(_chatGuid));
Debug.WriteLine("Device Waking Up");
}
}
Подробнее здесь: https://stackoverflow.com/questions/794 ... al-devices
Мобильная версия