A .net 7 implementation of sending messages with the push notification "Prowl" App.
Install ProwlAppSharp
via nuget (see nuget page - if you're not already here 😉).
using Prowl;
string prowlApiKey = Environment.GetEnvironmentVariable("PROWL_API_KEY");
ProwlMessage prowlMessage = new(prowlApiKey);
string appName = "My app name";
string description = "My message";
HttpResponseMessage prowlResponse = await prowlMessage.SendAsync(description, application: appName);
or just create your own ProwlMessageContents
object and pass that in:
using Prowl;
using Prowl.Enums;
using Prowl.Models;
ProwlMessage prowlMessage = new(prowlApiKey);
var myContents = new ProwlMessageContents
{
Description = "My main message",
Priority = Priority.Normal,
Url = "http://mysite.com",
Application = "MyApp",
Event = "My Event"
};
var prowlResponse = await prowlMessage.SendAsync(myContents);