TargetNotifiers are not fully implemented in all methods (especially GetSubscribedNotifications)
Hi,
There is a problem in supporting the TargetNotifiers approach to notifications.
The NotificationSubscriptionManager.GetSubscribedNotifications (both sync and async methods). Have no concept of the target notifiers.
As such it is not possible to work out if a user is subscribed for say one particular type of notifier over another.
Eg: They may be subscribed to a particular notifier for SMS but not Email or vice versa.
This code doesn't return the target notifiers https://github.com/aspnetboilerplate/aspnetboilerplate/blob/292754bf5368757da2e987b9876a057c4fbffb56/src/Abp/Notifications/NotificationSubscriptionInfoExtensions.cs#L16
As such there is no way to work out which notifier a user is subscribed for and you have to assume they are subscribed to ALL.
This is not necessarily the case however, given the NotificationSubscriptionManager.SubscribeAsync code allows you to specify which target notifiers you want to subscribe for.
I also note that unsubscribe will auto unsubscribe you from everything.
Generally there appear to be a few gaps in how the target notifiers is being used. I would suggest that SubscribeAsync should change how the IsSubscribedAsync code works to ignore target notifiers and just update the existing entry if it exists.
Unsubscribe should allow for specifying which notifier to unsubscribe from and then GetSubscribedNotifications should also return the target notifiers so you know which notifier a user is subscribed to.
Essentially I'm trying to update the code to allow a user to pick and chose which notifiers they want to subscribe to for different notifications.
The code is mostly there but there are gaps from what I can tell.
Source: aspnetboilerplate/aspnetboilerplate