Jump to content

SendNotificationToAllDevices Spam


frankrossouw

Recommended Posts

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

 

Link to comment
Share on other sites

  • Administrators

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.

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...