Skip to content

An unofficial PushNotifier API wrapper written in Java

Notifications You must be signed in to change notification settings

johannes-adr/PushNotifier4J

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PushNotifier4J

An unofficial PushNotifier API wrapper written in Java

Installation (via Maven)

add this to your projects pom.xml

<repositories>
  <repository>
    <id>jitpack.io</id>
    <url>https://jitpack.io</url>
  </repository>
</repositories>
<dependency>
  <groupId>com.github.johannes-adr</groupId>
  <artifactId>PushNotifier4J</artifactId>
  <version>V0.1</version>
</dependency>

Current version:

Example

PushNotifier pn = new PushNotifier("PACKAGE", "API_TOKEN");
pn.login("USERNAME", "PASSWORD");
		
DeviceResponse devices = pn.getDevices();
		
NotificationSendResult result = pn.sendNotification("Hello there","https://www.pushnotifier.de", devices.getAllDevices());
		
if(result.getFailureIds().size() > 0) {
  for(String deviceId : result.getFailureIds()) {
    Device device = devices.getDevicebyId(deviceId);
    System.out.println("Error sending notification to model " + device.getModel());
  }
}else {
  //Sucess
}

Everything you need is accessible in an instance of de.jadr.pushnotifier4j.PushNotifier

About

An unofficial PushNotifier API wrapper written in Java

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages