Skip to content
Switch branches/tags

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time

AeroGear Unified Push Java Client

Build Status Maven Central Javadocs License

A Java API for sending Push Notifications to the AeroGear UnifiedPush Server.

Project Info
License: Apache License, Version 2.0
Build: Maven
End User Documentation:
Community Documentation:
Issue tracker:
Mailing lists:!forum/aerogear

Getting started

Add the following dependencies to your pom.xml file:



Create a JavaSender:

PushSender defaultPushSender = DefaultPushSender
    .withRootServerURL("<pushServerURL e.g http(s)//host:port/context>")
    .pushApplicationId("<pushApplicationId e.g. 1234456-234320>")
    .masterSecret("<masterSecret e.g. 1234456-234320>")

You can also use an external config file:


    "serverUrl": "<pushServerURL e.g http(s)//host:port/context>",
    "pushApplicationId": "<pushApplicationId e.g. 1234456-234320>",
    "masterSecret": "<masterSecret e.g. 1234456-234320>"

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() {
        //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


See LICENSE file


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.