MrSimonC / Prowl-App-Sharp

A .net 6 implementation of sending messages with the Prowl App (for push notifications)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Prowl-App-Sharp

A .net 7 implementation of sending messages with the push notification "Prowl" App.

Installation

Install ProwlAppSharp via nuget (see nuget page - if you're not already here 😉).

Example Usage

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);

About

A .net 6 implementation of sending messages with the Prowl App (for push notifications)

License:MIT License


Languages

Language:C# 71.0%Language:PowerShell 29.0%