Giter VIP home page Giter VIP logo

npushover's Introduction

Logo NPushOver

.Net Pushover client (https://pushover.net), available as a NuGet package.

This library is not written or supported by Superblock (the creators of Pushover).

Quick start:

  • Register your application, set its name (and optionally upload an icon) and get an API token in return (referred to as ApplicationKey in NPushover).
  • Create an instance of the Pushover class and provide it with the ApplicationKey.
  • You're all set to send your first message!
var po = new Pushover("[APPLICATIONKEY-HERE]");

// Quick message:
var msg = Message.Create("Hello world!");
var sendtask = po.SendMessageAsync(msg, "[RECIPIENT-ID-HERE]");

The Message class contains several convenience-methods to quickly create a Message; however you can also simply instantiate your own:

var po = new Pushover("[APPLICATIONKEY-HERE]");

// Quick message:
var msg = new Message(Sounds.Siren)
{
    Title = "The roof!",
    Body = "The roof is on fire!",
    Priority = Priority.Emergency,
    RetryOptions = new RetryOptions
    {
        RetryEvery = TimeSpan.FromSeconds(30),
        RetryPeriod = TimeSpan.FromHours(3)
    },
    SupplementaryUrl = new SupplementaryURL
    {
        Uri = new Uri("http://robiii.me"),
        Title = "Awesome dude!"
    },
};
var sendtask = po.SendMessageAsync(msg, "[RECIPIENT-ID-HERE]");

All REST methods found in the Pushover API are available in this library. We support:

NPushover also has support for reading rate-limiting information returned by Pushover which should make it easy to find out in time when you're about to run out of messages.

Documentation

NPushover is well documented in code, comes with a helpfile (or Sandcastle helpfile builder project if you want to build it yourself). NPushover is built with Pushover's API documentation at hand. Though some names/properties may sometimes deviate a bit to make things more consistent within the API itself and/or to .Net conventions, you should be able to get around in NPushover quickly.

As more and more unittests are created, usage of specifics should be found easily in those unittests too.

Build status NuGet version

npushover's People

Contributors

robthree avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

npushover's Issues

Issue with a vb.net project

Hello Rob,

I have tried your solution in a vb.net project (VS 2015) :
I generate the dll for NPushOver reference it on my project and do a simple test like your hello word in a windows form application.
I have a issue cause it never go out of the Task.WaitAll(sendtask1)
The notification is sended but never go to the next line of my code

I've done the same in your test application in C# an all is ok.

Any idea ?

Thanks

Arnaud

Exception when canceling a Notification

Hello Rob, ... I'm back ;-)
When I send a emergency notification, It works, I got the receipt but I can't cancel it after, I got a 404 Not found exception :

var po = new Pushover("[APPLICATION-KEY-HERE]");

var msg2 = Message.Create(Priority.Emergency, "The roof!", "The roof is on fire!", false, Sounds.Siren);

msg2.RetryOptions = new RetryOptions { RetryEvery = TimeSpan.FromSeconds(30), RetryPeriod = TimeSpan.FromHours(3) };
msg2.SupplementaryUrl = new SupplementaryURL { Uri = new Uri("http://robiii.me"), Title = "Awesome dude!" };
var sendtask2 = po.SendMessageAsync(msg2, "[RECIPIENT-ID-HERE]", "[DEVICE-ID-HERE]");

Task.WaitAll(sendtask2);

var receipt = sendtask2.Result.Receipt;

System.Threading.Thread.Sleep(5000);

var sendtask3 = po.CancelReceiptAsync(receipt);

try
{
    Task.WaitAll(sendtask3);
}
catch (Exception ex)
{
    Console.WriteLine (ex.Message );
}

I also got an exception with the GetReceiptAsync.

Is It a problem from your lib or from PushOver ?

Thanks,

Arnaud

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.