I have an ABP.IO v4.4.2 project (.NET Core / Angular / Ionic) I'm using SignalR on angular and ionic(Android App)
when i send signalR to all clients in Web app (Angular or Ionic) it gives me warning and proceeds with code
Warning: No client method with the name 'XX' found.
but when i send signalR to all clients in Android app it gives me the same warning and stops
And this only happens when i send SignalR to all Clients
C# code
public async Task HandleEventAsync(DriverClientBookingUpdateEto bookingUpdateEto)
{
if (bookingUpdateEto.BookingTimeFrame == BookingTimeFrame.Future)
{
await _hubContext.Clients.All.SendAsync("DriverClientBookingUpdate", bookingUpdateEto);
}
else
{
string _groupName = bookingUpdateEto.Id.ToString();
if (bookingUpdateEto.ConnectionIds.Count == 0)
{
await _hubContext.Clients.Group(_groupName).SendAsync("DriverClientBookingUpdate", bookingUpdateEto);
}
else if (bookingUpdateEto.ConnectionIds.Count == 1)
{
await _hubContext.Clients.Client(bookingUpdateEto.ConnectionIds[0]).SendAsync("DriverClientBookingUpdate", bookingUpdateEto);
}
else if (bookingUpdateEto.ConnectionIds.Count > 1)
{
AddSurroundingDriversConnectionIdToGroup(bookingUpdateEto.ConnectionIds, _groupName);
await _hubContext.Clients.Group(_groupName).SendAsync("DriverClientBookingUpdate", bookingUpdateEto);
}
}
}
Typescript code
private registerSignalEvents() {
this.hubConnection.on('DriverClientBookingUpdate', (order: OrderModel) => {
this.orderSvc.handleOrderUpdate(order);
});
}
I just added console.log()
in handleOrderUpdate() method to try and debug it.
And now it works. I have no idea why; it's so unpredictable