I added a few new notifications to AppNotifier.cs. For Example:
public async Task NotifyMemberOfGroupUpdateAsync(User reciever, User invitingUser, long groupId, string message, NotificationType notificationType)
{
var notificationData = new MessageNotificationData(message);
notificationData["memberPictureUrl"] = (invitingUser.ProfilePicture != null) ? invitingUser.ProfilePicture.LocationUrl : "";
notificationData["groupId"] = groupId;
notificationData["notificationType"] = (int)notificationType;
await _notificationPublisher.PublishAsync(
AppNotificationNames.NotifyMemberOfGroupUpdateAsync,
data: notificationData,
severity: NotificationSeverity.Info,
userIds: new[] { reciever.ToUserIdentifier() });
}
My question is, when these notifications are published, is it automactically also emitted via signalR or do I need to do somthing to emit it realtime via signalR. I checked the SignalRChatCommunicator.cs file in the Web.Core project and I don't see a signalR method that is sending it. I only see (getChatMessage, getFriendshipRequest, getUserConnectNotification, getUserStateChange, getallUnreadMessagesOfUserRead and getReadStateChange)
2 Answer(s)
-
0
Hi @suruat
It is automatically published but not via SignalRChatCommunicator.cs. It is published via https://github.com/aspnetboilerplate/aspnetboilerplate/blob/dev/src/Abp.AspNetCore.SignalR/AspNetCore/SignalR/Notifications/SignalRRealTimeNotifier.cs.
You can read more about it here.
-
0
Thanks!