Home
Softono

Rpush Server

Open source Ruby
17
Stars
1
Forks
3
Issues
1
Watchers
1 year
Last Commit

 About Rpush Server

Keep push tokens from mobile devices and send push notifications to iOS/Android

Platforms

Web Self-hosted Cloud iOS Android

Languages

Ruby

Need Help Installing Rpush Server?

We provide expert installation service for this software. Our team will install, configure, and secure Rpush Server on your server. plans start at just $30.

Rpush Server

View on GitHub

Rpush-server

Rpush-server logo by Shen

A simple push server implementation based on RPush.

  • Simple. Has an admin panel for managing push notifications credentials, users and push tokens.
  • Powerful. Has all API methods for keeping push tokens and sending messages.
  • No DevOps needed. Easy deploy to Heroku or Dokku.

The RPush server admin panel is accessible by the link.

Default credentials: admin & admin

Run the RPush server in development mode

  1. Install dependencies

    brew install libpq
    brew install postgresql@14
    brew install overmind
    npm install --global yarn
    yarn install
    
  2. Create db and run migrations

    rails db:setup
    
  3. Run a Procfile_dev processes

    yarn s
    

Auth

Generate mobile_token using the admin page:

Create mobile device

Open the app dashboard and fill in credentials for APNS and Firebase.

Credentials page

Endpoints

Create mobile device

Run this method every time after starting a mobile application.

POST /mobile_devices Params:

{
    "mobile_device": {
        "device_token": "mobile_device_push_token",
        "device_type": "ios" // ios/android
    },
    "mobile_user": {
        "external_key": 123, // server user identifier
        "environment": "development" // development/production
    }
}

Headers:

{ Authorization: "Bearer client_token" }

Response:

{}

Response status: 200

Remove mobile device

Run this method when the user logout.

DELETE /mobile_device/:push_token

Response:

{}

Response status: 200

Create push notifications

Run this method on the server side

POST /push_notifications Params:

{
    "message": {
        "title": "New message",
        "message": "Hello Mark",
        "data": {},
        "data_notification": {}
    },
    "mobile_user": {
        "external_key": 123, // server user identifier
        "environment": "production" // development/production
    },
    device_type: 'android' // ios/android/all
}

Headers:

{ Authorization: "Bearer server_token" }

Response:

{}

Response status: 200

Restore production backup for local development purposes

 pg_restore --verbose --clean --no-acl --no-owner -U postgres -d rpush_server_dev < [path_to_backup]