Install RBT: Push notifications
The optional push service delivers call and event notifications to branded or shared mobile applications through Firebase Cloud Messaging and Apple Push Notification service credentials.
This page is one step in the complete RBT installation guide.
Before you start
- Obtain project-specific FCM credentials and an Apple VoIP push certificate.
- Store private credential files outside public directories with restrictive permissions.
- Use the same application identifiers that were configured for the mobile builds.
Expected result
The systemd instance should stay active, write its logs under the configured directory and deliver a test notification to each supported mobile platform.
Verify this step
systemctl is-active push@0.service
journalctl -u push@0.service -n 50 --no-pager
OPTIONAL
Push notification service
-
Install dependencies
shell cd /opt/rbt/server/services/push npm install -
Make file environment ".env" and edit vars
shell cp .env_example .env -
Put your FCM and APN files into "assets" folder
assets/pushServiceAccountKey.json
assets/certificate-and-privatekey.pem
pushServiceAccountKey.json - data from Firebase Cloud Messaging (FCM)
certificate-and-privatekey.pem - certificate for Apple's VoIP APN
shell
openssl pkcs12 -in <YOUR-VOIP-CERTIFICATE>.p12 -out assets/certificate-and-privatekey.pem -nodes -legacy
-
Add user and group:
shell groupadd rbt useradd -g rbt -s /bin/true -d /dev/null rbt -
Make logging dir:
shell mkdir -p /var/log/rbt_push_service/ chown -R rbt:rbt /var/log/rbt_push_service/ -
Make logrotate:
shell echo '/var/log/rbt_push_service/*.log { daily missingok rotate 7 compress notifempty copytruncate dateext dateformat -%Y-%m-%d }' | tee /etc/logrotate.d/rbt_pushRestart service
shell systemctl restart logrotate -
Make service:
shell ln -sf /opt/rbt/server/services/push/push.service /usr/lib/systemd/system/push@.service -
Enable and start service
shell systemctl enable push@0.service --now