minipush is a simple, API-only push notification server for sending notifications to iOS devices.
You need a redis server running.
- Clone the repo
npm installcp config-example.json config.jsonnode minipush.js
minipush is configured via the config.json file.
Configure port and host of your redis server.
minipush only supports Provider Authentication Tokens. You need to generate an APNS token (p8-file) in the Developer Portal. You also need to set your team id and key id. More info.
You define one or more applications to send token to. Each application has a identifier and a bundleId.
identifier(String) is the application identifier. Must be uniq.bundleId(String) is the bundle id of your app. Multiple applications can share the same bundle id. This is usefull when having a sandbox app.sandbox(Bool, optional) iftruethe sandbox environment is used when sending notifications to this application.
POST /api/tokens/[identifier]
Authorization: Bearer 7777e7568695fe1638a1f8f4e3e08ac8dc9131d2
{"token": "2342badcaffee425918",
"tags": ["en"]}
DELETE /api/tokens/[identifier]?token=2342badcaffee425918
Authorization: Bearer 7777e7568695fe1638a1f8f4e3e08ac8dc9131d2
The tags property determines where the push messages are sent. If it is omnited or empty the message is to all registered devices.
POST /api/message/[identifier]
Authorization: Bearer 32698b262bf107767a87cd2d72624172461a7392
{
"tags": ["en"],
"title": "Title",
"badge": 23,
"sound": "default",
"body": "Message text can be longer",
"payload": {
"url": "https://github.com",
"foo": "bar"
}
}
MIT, see LICENSE