In Xamrin SignalR show connection status "disconnected".
- protected override async void OnAppearing()
- {
- base.OnAppearing();
-
- connection = new HubConnectionBuilder()
- .WithUrl("http://localhost:26523/chat")
- .Build();
-
- connection.On<string, string>("Send", (name, message) =>
- {
- SignalRResult.Text = name + " - " + message;
- });
-
- if (connection.State == HubConnectionState.Disconnected)
- {
- try
- {
- await connection.StartAsync(); // Not working
- }
- catch (Exception ex)
- {
-
- }
- }
-
- }
I'm running the SignalR Hub in my local IIS. Web client working fine, Xamrin client not establishing connection.