Skip to content

Instantly share code, notes, and snippets.

@matzew
Created July 4, 2014 06:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save matzew/fd3f85a01aa3e46157c7 to your computer and use it in GitHub Desktop.
Save matzew/fd3f85a01aa3e46157c7 to your computer and use it in GitHub Desktop.
SimplePushClient client = new SimplePushClient("wss://push.services.mozilla.com");
client.connect();
client.register(new RegistrationListener() {
@Override
public void onRegistered(String channelId, String pushEndpoint) {
System.out.println(pushEndpoint);
}
});
client.addMessageListener(new MessageListener() {
@Override
public void onMessage(Ack ack) {
System.out.println("Message received for " + ack);
}
});
try {
Thread.currentThread().join();
}
catch (InterruptedException e) {
e.printStackTrace();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment