Send Push Notifications Over PushOver

9 years 1 week ago - 9 years 1 week ago #2502 by lennysh
Just figured I'd share the code I'm using to send notifications using PushOver from the EasyIoT Server...

(If you prefer to use PushBullet instead, I posted that code on this topic ...)

Enjoy!
public void PushOverSend(string Title, string Msg)
{
	System.Collections.Specialized.NameValueCollection queryString = new System.Collections.Specialized.NameValueCollection();
	queryString["token"] = "Application API Token/Key";
	queryString["user"] = "Your User Key";
	queryString["title"] = Title;
	queryString["message"] = Msg;

	try {
      	System.Net.ServicePointManager.ServerCertificateValidationCallback = new System.Net.Security.RemoteCertificateValidationCallback(delegate { return true; });
		using (System.Net.WebClient client = new System.Net.WebClient()) {
			client.UploadValues("https://api.pushover.net/1/messages.json", queryString);
		}

	} catch (Exception ex) {
		Console.WriteLine(ex.Message);
	}
}

And here is how to use the code in an Automation Program...
PushOverSend("EasyIoT Message", "Test Message from my PushOver Code!");

Please Log in or Create an account to join the conversation.

Time to create page: 0.317 seconds

Forum latest

  • No posts to display.