Posted December 4, 201212 yr 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
December 4, 201212 yr 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.
December 4, 201212 yr Author So there is currently no way to prevent the spam automatically and I should build in a programmatic control measure?
December 4, 201212 yr For now, yes. The change has been implemented and will be included in the next release.
Create an account or sign in to comment