Skip to content
Java API to access the Unified Push Server
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
src 💨 adding batch handler, and some jdk8 ❤️ Feb 18, 2017
.travis.yml Using JDK8 on travis Apr 13, 2016

aerogear-unifiedpush-java-client Build Status

A Java API for sending Push Notifications to the AeroGear UnifiedPush Server. For more information, please visit the Java Sender Tutorial for example usages.

Project Info
License: Apache License, Version 2.0
Build: Maven
Issue tracker:
Mailing lists: aerogear-users (subscribe)
aerogear-dev (subscribe)

Getting started

Add the following dependencies to your pom.xml file:



Create a JavaSender:

PushSender defaultPushSender = DefaultPushSender

You can also use an external config file:


    "serverUrl": "",
    "pushApplicationId": "c7fc6525-5506-4ca9-9cf1-55cc261ddb9c",
    "masterSecret": "8b2f43a9-23c8-44fe-bee9-d6b0af9e316b"}

And then :

PushSender defaultPushSender = DefaultPushSender

To connect via proxy:

PushSender defaultPushSender = DefaultPushSender
    .proxy("", 8080)

To use a custom TrustStore:

PushSender defaultPushSender = DefaultPushSender
    .customTrustStore("setup/aerogear.truststore", "jks", "aerogear")

Send a message

Construct a UnifiedMessage using the Builder :

UnifiedMessage unifiedMessage = UnifiedMessage.withCriteria()
    .aliases("john", "maria")
        .alert("Hello from Java Sender API!")
        // iOS specific
        // optional specific to your app
        .userData("some_key", "some_value")
        // optional cordova Android specific attribute (default is appName)
        .userData("title", "Cool Title") 

Create a callback

MessageResponseCallback callback = new MessageResponseCallback() {
    public void onComplete(int statusCode) {
        //do cool stuff

Send the message

defaultPushSender.send(unifiedMessage, callback); 

You can also omit the callback


Known issues

On Java7 you might see a SSLProtocolException: handshake alert: unrecognized_name expection when the UnifiedPush server is running on https. There are a few workarounds:

  • JBoss' standalone.xml configuration file:

    <property name="jsse.enableSNIExtension" value="false"/>
  • in the Java app, that is using the Java Client SDK: System.setProperty("jsse.enableSNIExtension", "false");
  • Or via commandline argument: -Djsse.enableSNIExtension=false


For more details about the current release, please consult our documentation.


If you would like to help develop AeroGear you can join our developer's mailing list, join #aerogear on Freenode, or shout at us on Twitter @aerogears.

Also takes some time and skim the contributor guide


Join our user mailing list for any questions or help! We really hope you enjoy app development with AeroGear!

Found a bug?

If you found a bug please create a ticket for us on Jira with some steps to reproduce it.

You can’t perform that action at this time.