English | 简体中文
Chanify is a safe and simple notification tools. For developers, system administrators, and everyone can push notifications with API.
- Install iOS App(1.0.0 version and above).
- Get send token, more detail.
- Send message.
Download precompiled binary from this.
$ docker pull wizjin/chanify:latest
$ go install github.com/chanify/chanify
Use chanify to send message.
$ chanify send --token=<token> --text=<message>
Chanify run in stateless mode, no device token will be stored in node.
All device token will be stored in api.chanify.net.
Message will send to apple apns server by api.chanify.net.
Send message workflow:
Start => node server => api.chanify.net => Apple server => iOS client
# Start chanify
$ chanify serve --host=<ip address> --port=<port> --secret=<secret key> --name=<node name> --endpoint=http://<address>:<port>
# Docker
$ docker run -it wizjin/chanify:latest serve --secret=<secret key> --name=<node name> --endpoint=http://<address>:<port>
Chanify run in stateful mode, device token will be stored in node.
Message will send to apple apns server direct.
Send message workflow:
Start => node server => Apple server => iOS client
Start server
# Start chanify
$ chanify serve --host=<ip address> --port=<port> --name=<node name> --datapath=~/.chanify --endpoint=http://<address>:<port>
# Docker
$ docker run -it -v /my/data:/root/.chanify wizjin/chanify:latest serve --name=<node name> --endpoint=http://<address>:<port>
Use MySQL as a backend
--dburl=mysql://<user>:<password>@tcp(<ip address>:<port>)/<database name>?charset=utf8mb4&parseTime=true&loc=Local
Chanify will not create database.
- Start node server
- iOS client can scan QRCode(
http://<address>:<port>/
) to add node.
# Text message
$ curl --form-string "text=hello" "http://<address>:<port>/v1/sender/<token>"
# Text file
$ cat message.txt | curl -H "Content-Type: text/plain" --data-binary @- "http://<address>:<port>/v1/sender/<token>"
from urllib import request, parse
data = parse.urlencode({ 'text': 'hello' }).encode()
req = request.Request("http://<address>:<port>/v1/sender/<token>", data=data)
request.urlopen(req)
require 'net/http'
uri = URI('http://<address>:<port>/v1/sender/<token>')
res = Net::HTTP.post_form(uri, 'text' => 'hello')
puts res.body
const https = require('https')
const querystring = require('querystring');
const data = querystring.stringify({ text: 'hello' })
const options = {
hostname: '<address>:<port>',
port: 80,
path: '/v1/sender/<token>',
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
'Content-Length': data.length
}
}
var req = https.request(options, (res) => {
res.on('data', (d) => {
process.stdout.write(d);
});
});
req.write(data);
req.end();
- GET
http://<address>:<port>/v1/sender/<token>/<message>
- POST
http://<address>:<port>/v1/sender/<token>
Content-Type:
text/plain
: Body is text messagemultipart/form-data
: The block of data("text") is text messageapplication/x-www-form-urlencoded
:text=<url encoded text message>
Additional params
Key | Description |
---|---|
title | The title for notification message. |
sound | 1 enable sound, otherwise disable sound |
priority | 10 default, or 5 |
E.g.
http://<address>:<port>/v1/sender/<token>?sound=1&priority=10&title=hello
Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the MIT License. See LICENSE
for more information.