Jump to content
View in the app

A better way to browse. Learn more.

Pulseway

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

 

void PluginDataCheck()

This is where your plugin checks whether it needs to inform you about something, perfect place for notifications to be sent. It gets called automatically every 15-20 seconds.

 

 

I'm looking for a way to delay this check. I'm running queries and I don't want to burden my server too much. Does anybody have a best practice to decrease to, for example every five minutes.

 

 

  • Administrators

Well you could do a couple of things here:

  • Use a nullable DateTime field that indicates the last time the query execute and if (DateTime.now - lastValue.Value).TotalMinutes == 5 (check for null before using .Value) then execute your query, otherwise ignore the call
  • On the constructor create a Thread or a Task that runs a while loop that checks for a variable that you set it to true when the plugin is unloaded. Use Thread.Sleep to delay the next execution.
  • On the constructor create a Timer that runs every 5 minutes. Don't forget to stop the time when the plugin is disabled.

I believe I've used custom timers in one of my plugins, why not check them out for sample code (all my plugins come with the source code included).

Create an account or sign in to comment

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.