Here we are using asp.net core singnalR alpha2 version. How to send notification for groups (group of users)? If any sample is there for scenario, post here the sample link.
In Hub write method with group.
public class SignalRCommonHub : Hub
{
public void SendToGroup(int groupId, int userId)
{
Clients.Group(groupId.ToString()).InvokeAsync("refresh", groupId, userId);
}
}
In controller called the hub method.
private readonly IHubContext<SignalRCommonHub> isignalRhub;
public SignalRModel(IHubContext<SignalRCommonHub> signalRhub)
{
this.isignalRhub = signalRhub;
}
public void RefreshPage(int groupId, int userId)
{
this.isignalRhub.Clients.Group(groupId.ToString()).InvokeAsync("refresh", groupId, userId);
}
In client side not trigger when call method in client side.
User online status update based on groups (group of users) using signalR sample available means post here link. Suggest idea for how to implement the user online status.
Thanks,