A server for proxying push notifications to iOS devices from Mattermost, a self-hosted team communication solution.
For organizations who want to keep internal communications behind their firewall, this service encrypts notification messages with a private key under your control before sending them to Apple's public push notification service for delivery to your iOS devices.
- A linux Ubuntu 14.04 server with at least 1GB of memory.
- Having either compiled the Mattermost iOS app and submitted it to the Apple App Store, or hosted in your own Enterprise App Store.
- Private and public keys obtained from the Apple Developer Program
- Install the latest release of the Mattermost Notification Server.
- Create a directory, for example
/home/ubuntu/push-proxy
. - Download Mattermost Notification Server v2.0 with
wget https://github.com/mattermost/push-proxy/releases/download/v2.0/matter-push-proxy.tar.gz
. - Uncompress the file with
tar -xvzf matter-push-proxy.tar.gz
. - Update
config.json
with your private and public keys. - Edit using
vi /home/ubuntu/push-proxy/config/config.json
and setApplePushCertPublic
andApplePushCertPrivate
, this should be a path to the public and private keys previously generated. For example
"ApplePushCertPublic": "./config/publickey.cer",
"ApplePushCertPrivate": "./config/privatekey.pem",
- Edit using
vi /home/ubuntu/push-proxy/config/config.json
and setAndroidApiKey
, this should be a key generated from Google Cloud Messaging. For example
"AndroidApiKey": "DKJDIiwjerljd290u34jFKDSF",
- Verify push notifications are working by mentioning a user who is offline, which should trigger a push notification.
- You can verify that the server operates normally by using curl:
curl http://127.0.0.1:8066/api/v1/send_push -X POST -H "Content-Type: application/json" -d '{ "message":"test", "badge": 1, "platform":"apple", "server_id":"MATTERMOST_DIAG_ID", "device_id":"IPHONE_DEVICE_ID"}'
Replace MATTERMOST_DIAG_ID and IPHONE_DEVICE_ID with the relevant values.