I am trying to send a notification to the tenant but nothing happens, not even record entered to the '[AbpNotifications]' table. I don't know where things went wrong.
using (UnitOfWorkManager.Current.SetTenantId(tenantId))
{
var notificationData = new LocalizableMessageNotificationData(new LocalizableString("OverDueTaskManagementReminderMessage", DConsts.LocalizationSourceName));
notificationData["a"] = "Accomplish By" + ws.WorkStream.AccomplishOn.ToString("dd/MM/yyyy hh:mm");
notificationData["pn"] = user.Surname + "" + user.Name;
notificationData["tmp"] = WorkStreamPriority.Urgent.ToString();
AsyncHelper.RunSync(() => _notificationPublisher.PublishAsync(AppNotificationNames.OverDueTaskManagementReminder,
notificationData, severity: NotificationSeverity.Info));
UnitOfWorkManager.Current.SaveChanges();
return true;
}
Subscribed before publish and the code as below, this time notification didn't insert in host db nor in tenant db
await _notificationSubscriptionManager.SubscribeAsync(new UserIdentifier(tenantId, (long)(AbpSession.UserId??1)), AppNotificationNames.OverDueTaskManagementReminder);
var result = _notificationPublisher.PublishAsync(AppNotificationNames.OverDueTaskManagementReminder,
notificationData, severity: NotificationSeverity.Info, tenantIds: new[] { tenantId }.Select(x => (int?)Convert.ToInt32(x)).ToArray()).IsCompleted;
return result;