Git Product home page Git Product logo

upns_old's Introduction

Unified Push Notifications Service (V1)

Build Status

Alt Architecture

Requirements:

In progress ...

Client Integration

Registration

Request:

POST /api/v1/subscribers/:id?platform={platform}&service={service_name}&token={push_token}

Response:

Status: 201 Created || 204 No Content

Retrieving Payload of a Push Notification

To retrieve a push notification's payload you should send the ID of the notification as a parameter.

Type

Allows different resources to be opened via push notifications. Moreover you could make client to open URL when user clicks on push notification. For URL notification you could set in which browser should the URL be opened and browser title. For launching in the default browser set "default_browser" :true, for internal browser "default_browser" :false.

Request:

GET /api/v1/events/:id/payload

Response:

Status: 200 OK
{
    "payload": {
		"type": "image",
        "category": "animals",
        "watermark": "Our new Hippo is here!!!"
    }
}

Server Integration

Send Notification

Create and send push notification

Request:

POST /api/v1/events
Content-Type: application/json
{
    "headers": {
        "type": "text",
        "text": "New text push received!"        
    },
    "payload": {
		"content": "Content text"
    },
    "target": {
        "services": [ "test", "test1" ],
        "platforms": [ "ios", "android", "windows" ]
    }
}

Response:

Status: 200 OK
notification:{
  "id": "545e556514a01fbc16773558"
}

Resend push notification

Request:

POST /api/v1/notifications/:id

Response:

Status: 200 OK
notification:{
  "id": "545e556514a01fbc16773558"
}

Headers

Text

Short text notification message.

Request:

POST /api/v1/notifications
Content-Type: application/json
{
    "headers": {
        "text": "New LINK push received!"        
    },
    "payload": {
		"type": "link",
    	"url" : "http://example.com",
    	"default_browser" : true,
    	"browser_title" : "Custom title"
    },
    "target": {
    	"services": ["test", "test1"],
    	"platforms": ["ios", "android", "wp"]
    }
}

Target

Use JSON format for target request param. You can target by following params:

  • services
  • platforms (Valid: ["windows", "ios", "android"])
  • id
  • locale
  • country
  • version

Example: Target all iOS devices from Singapore with application version (less than or equal to 2) or (more than or equal to 4, but less than 5)

{
  "platforms" : "ios",
  "country" : "sg",
  "version" : ["<= 2","~> 4"]
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.