diff --git a/README.md b/README.md index 114a7ed..2bcf166 100644 --- a/README.md +++ b/README.md @@ -3,12 +3,12 @@ JPushover ================ -A minimal (15 KB), zero-dependency convenient class for sending messages to [Pushover][1] in Java. +A simple, minimal (18 KB), zero-dependency convenient class for sending messages to [Pushover][1] in Java. + +Supports [Messages API][3] and [Glances API][4], synchronous and asynchronous sending. Requires Java 11. -Supports [Messages API][3] and [Glances API][4]. - Usage ------------------ @@ -41,13 +41,16 @@ JPushover.newGlance() When using the Message API you can additionally add available options from the official [Pushover documentation][2] You can also validate a user and token using the following method + ``` boolean valid = JPushover.newMessage() .withToken("MyToken") .withUser("MyUser") .validate(); ``` + If you want more information and/or the response from the Pushover API, use the PushoverResponse object. + ``` PushoverResponse PushoverResponse = JPushover.newMessage() .withToken("MyToken") @@ -55,7 +58,24 @@ PushoverResponse PushoverResponse = JPushover.newMessage() .withMessage("MyMessage") .push(); ``` -The PushoverResponse will return the raw HTTP status code, along with the raw JSON response and a convenient boolean if the request was successful or not. + +The PushoverResponse will return the raw HTTP status code, along with the raw JSON response and a convenient boolean if the request was successful or not. Additionally you get the rate limit information along with the response (rate limit, remaining, reset timestamp). + +Sending a Message or Glance asynchronous is simple. Just call the pushAsync() method instead of push(). Examples: + +``` +JPushover.newMessage() + .withToken("MyToken") + .withUser("MyUser") + .withMessage("MyMessage") + .pushAsync(); + +JPushover.newGlance() + .withToken("MyToken") + .withUser("MyUser") + .withText("MyText") + .pushAsync(); +``` [1]: https://pushover.net [2]: https://pushover.net/api diff --git a/pom.xml b/pom.xml index 9e633f8..9231c8e 100644 --- a/pom.xml +++ b/pom.xml @@ -20,9 +20,6 @@ 11 UTF-8 - 1.7.0-M1 - 5.7.0-M1 - 2.11.1 scm:git:git@github.com:svenkubiak/JPushover.git