Try our conversational search powered by Generative AI!

INotifier examples - documentation not clear


I'm still confused after reading these two documentation pages.

I've implemented the:

private static readonly INotificationUser NotificationSender = new NotificationUser("SystemNotificationSender");
public const string NotificationChannelName = "ExecutableJob.Invoke.Process";

await _notifier.PostNotificationAsync(new NotificationMessage
    ChannelName = NotificationChannelName,
    Subject = broadcasted.Subject,
    Content = broadcasted.Message,
    Recipients = new[] { new NotificationUser(broadcasted.UserName)  }, // Logged in User
    Sender = NotificationSender,
    TypeName = "OnStatusChange"

and in startup:

var optionsRegistry = app.ApplicationServices.GetRequiredService<INotificationChannelOptionsRegistry>();
optionsRegistry.Add(...NotificationChannelName, new NotificationChannelOptions(true));

I do not need to format it in a special way I just want it displayed as is, but nothing is shown in the "notifications" tab.

What am I missing?

Do I need to implement my own notification handling?

Or my own subscription thing?

Feb 20, 2024 9:12

Hi Carl

For the notifications icon, there should be no channel filtering. It should show all notifications for the user.

Have you confirmed that the notifications are stored correctly in the database? And that the receiver user name matches the one in your session, exactly?

Does it show up if you omit the recipient (emulating a general notification for all users)?

Mar 29, 2024 15:13

Hi Stefan,

I just gave up since no one answered in such a long time and went with SignalR instead which made it easier.

Apr 02, 2024 5:04
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.