Implementation of notification service to which devices can register to receive push notifications.
Uses Tify a Push notification services abstraction layer.
clone https://github.com/juliangut/tify_example
cd tify_example
composer install
Create api.key
and/or certificate.pem
files in config directory to store your GCM api key and APNS certificate.
grunt serve
Or if you don't have grunt installed
php -S localhost:9000 -t public
curl -X PUT -H "Host: localhost:9000" -H "Accept: application/json" -H "Content-Type: application/json" -d '{"token": "device_token"}' "http://localhost:9000/register"
- token: device token
- platform: device platform (ios/android)
Device tokens can and should be changed from time to time, and then updated into the server to correctly receive push notifications.
curl -X PUT -H "Host: localhost:9000" -H "Accept: application/json" -H "Content-Type: application/json" -d '{"token": "device_token","previous_token":"previous_device_token"}' "http://localhost:9000/register"
- token: device token
- previous_token: previously saved device token to be replaced
curl -X POST -H "Host: localhost:9000" -H "Accept: application/json" -H "Content-Type: application/json" -d '{"title": "Push_title","body": "push_body","platform": "android"}' "http://localhost:9000/send"
- title: notification title
- body: notification content body
- platform: (optional) platform to send to, all if not provided
- data: (optional) key/value array of extra data to be appended to the notification
Found a bug or have a feature request? Please open a new issue. Have a look at existing issues before.
See file CONTRIBUTING.md
See file LICENSE included with the source code for a copy of the license terms.