Skip to content

sps/pushover4j

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pushover4j

Build Status Coverage Status

A java client for pushover

PushoverClient client = new PushoverRestClient();        

client.pushMessage(PushoverMessage.builderWithApiToken("MY_APP_API_TOKEN")
        .setUserId("USER_ID_TOKEN")
        .setMessage("testing!")
        .build());

// push a message with optional fields
Status result = client.pushMessage(PushoverMessage.builderWithApiToken("MY_APP_API_TOKEN")
      .setUserId("USER_ID_TOKEN")
      .setMessage("testing!")
      .setDevice("device")
      .setPriority(MessagePriority.HIGH) // HIGH|NORMAL|QUIET
      .setTitle("title")
      .setUrl("https://github.com/sps/pushover4j")
      .setTitleForURL("pushover4j github repo")
      .setSound("magic")
      .build());
      
System.out.println(String.format("status: %d, request id: %s", result.getStatus(), result.getRequestId()));

// get and print out the list of available sounds:
for (PushOverSound sound : client.getSounds() ) {
    System.out.println(String.format("name: %s, id: %s", sound.getName(), sound.getId()));
}              

for the non-maven types, here are the required dependencies