frankrossouw Posted December 4, 2012 Posted December 4, 2012 Hi We're writing a little plugin that sends notifications. The problem is that the plugin now spams notifications and does not take heed of the CanSendNotification. I get 40 of the same message appearing. public override void PluginDataCheck() { if (CanSendNotifications) { SendNotificationToAllDevices("bLAHbLAH", NotificationPriority.CRITICAL); } } Am I misunderstanding what the cansendnotifications property means? I am under the impression that this property will switch to false after I send the first time? And only after viewing the message will it revert back to true? Kind Regards Frank
Marius Posted December 4, 2012 Posted December 4, 2012 This is no longer the case - the last API update removes this restriction. CanSendNotifications property is still valid for cases when the agent itself won't be able to send notifications from other reasons and you should still check that. We will add in the next release a way of setting that notification so that it's not allowing duplicates like: public bool SendNotificationToAllDevices(string message, NotificationPriority priority, bool allowMultipleNotifications = false) However, CanSendNotifications will still return true unless the agent itself is not allowed to send any notifications.
frankrossouw Posted December 4, 2012 Author Posted December 4, 2012 So there is currently no way to prevent the spam automatically and I should build in a programmatic control measure?
Marius Posted December 4, 2012 Posted December 4, 2012 For now, yes. The change has been implemented and will be included in the next release.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now