Server Libraries

Arrow right Prerequisites

Sign up for a ZeroPush account. Find the server_token on the settings page.

Cloud Server Side Concerns

When integrating with ZeroPush, your server must be able to perform the following actions:

  • Save the device token and associate it with a user in your database.
  • Make a request to ZeroPush when you want to send a notification.

Both actions are standard HTTP POST requests, so they can be implemented in any language.

Ruby Ruby/Rails

For Ruby applications, the zero_push gem provides a convenient wrapper around the ZeroPush API.


Add the following to your Gemfile

gem 'zero_push'

Install the gem with bundler

$> bundle install

If you are using Rails, you can run the generator

$> rails g zero_push:install

The generator will create an initializer in config/initializers/zero_push.rb with the following content:

if Rails.env.development?
  ZeroPush.auth_token = "development token"
  ZeroPush.auth_token = "production token"

If you are using some other Rack based web server, you should set the auth_token similarly.

if ENV['RACK_ENV'] == "development"
  ZeroPush.auth_token = "development token"
  ZeroPush.auth_token = "production token"

Sending a push notification:

notification = {
  device_tokens: [device_token_one, device_token_two],
  alert: "Something really awesome just happened!",
  sound: "default",
  badge: 1



The source code for the gem can be found on our GitHub page

Django Django

For Django applications django-zeropush provides a convenient wrapper around the ZeroPush API, as well as providing registration endpoints for device token management.


Please see the django-zeropush README for information about adding it to your application.

Sending a push notification to a single device:

import zeropush

# Get a user. Can also be a custom user model in django 1.5+
the_user = User.objects.filter(username="johndoe")

zeropush.notify_user(the_user, alert="Here's some notification text", sound="default", badge_number=1)


For PHP applications see: ZeroPush-PHP

Sample Usage:


$client = new ZeroPush('your-auth-token');
$response = $client->broadcast(array('alert' => 'Hello, World'));

Speech bubble left eJabberd

For sending push notifications directly from eJabberd, mod_zeropush provides a convenient module to send push notifications to offline users.

When using mod_zeropush make sure to use the broadcast channels to assign device tokens to specific jabber ids.


Refer to the readme for instructions how to install mod_zeropush for ejabberd 2.1.x and 13.10

updated on Thu Jan 1 09:34:11 2015