Update README.md
This commit is contained in:
67
README.md
67
README.md
@ -14,47 +14,50 @@ Usage
|
|||||||
|
|
||||||
1) Add the jpushover dependency to your pom.xml:
|
1) Add the jpushover dependency to your pom.xml:
|
||||||
|
|
||||||
<dependency>
|
```
|
||||||
<groupId>de.svenkubiak</groupId>
|
<dependency>
|
||||||
<artifactId>jpushover</artifactId>
|
<groupId>de.svenkubiak</groupId>
|
||||||
<version>x.x.x</version>
|
<artifactId>jpushover</artifactId>
|
||||||
</dependency>
|
<version>x.x.x</version>
|
||||||
|
</dependency>
|
||||||
|
```
|
||||||
|
|
||||||
2) Use the JPushover object with the required informations were you want
|
2) Use the JPushover object with the required informations were you want
|
||||||
|
|
||||||
JPushover.newMessage()
|
```
|
||||||
.withToken("MyToken")
|
JPushover.newMessage()
|
||||||
.withUser("MyUser")
|
.withToken("MyToken")
|
||||||
.withMessage("MyMessage")
|
.withUser("MyUser")
|
||||||
.push();
|
.withMessage("MyMessage")
|
||||||
|
.push();
|
||||||
JPushover.newGlance()
|
|
||||||
.withToken("MyToken")
|
JPushover.newGlance()
|
||||||
.withUser("MyUser")
|
.withToken("MyToken")
|
||||||
.withText("MyText")
|
.withUser("MyUser")
|
||||||
.push();
|
.withText("MyText")
|
||||||
|
.push();
|
||||||
|
```
|
||||||
|
|
||||||
When using the Message API you can additionally add available options from the official [Pushover documentation][2]
|
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
|
You can also validate a user and token using the following method
|
||||||
|
```
|
||||||
boolean valid = JPushover.newMessage()
|
boolean valid = JPushover.newMessage()
|
||||||
.withToken("MyToken")
|
.withToken("MyToken")
|
||||||
.withUser("MyUser")
|
.withUser("MyUser")
|
||||||
.validate();
|
.validate();
|
||||||
|
```
|
||||||
If you want more information and/or the response from the Pushover API, use the JPushoverResponse object.
|
If you want more information and/or the response from the Pushover API, use the JPushoverResponse object.
|
||||||
|
```
|
||||||
JPushoverResponse jPushoverResponse = JPushover.newMessage()
|
JPushoverResponse jPushoverResponse = JPushover.newMessage()
|
||||||
.withToken("MyToken")
|
.withToken("MyToken")
|
||||||
.withUser("MyUser")
|
.withUser("MyUser")
|
||||||
.withMessage("MyMessage")
|
.withMessage("MyMessage")
|
||||||
.push();
|
.push();
|
||||||
|
```
|
||||||
The JPushoverResponse 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 JPushoverResponse will return the raw HTTP status code, along with the raw JSON response and a convenient boolean if the request was successful or not.
|
||||||
|
|
||||||
[1]: https://pushover.net
|
[1]: https://pushover.net
|
||||||
[2]: https://pushover.net/api
|
[2]: https://pushover.net/api
|
||||||
[3]: https://pushover.net/api
|
[3]: https://pushover.net/api
|
||||||
[4]: https://pushover.net/api/glances
|
[4]: https://pushover.net/api/glances
|
||||||
|
Reference in New Issue
Block a user