Push Notifications Configuration
Configure push notifications through the Admin Panel.
FCM Setup
Prerequisites
- Firebase project
- FCM service account credentials
Configuration Steps
- Go to Admin Panel > Push Notifications > Settings
- Enable module
- Upload Firebase service account JSON
- Save
Service Account JSON
Get from Firebase Console:
- Go to Project Settings > Service Accounts
- Click Generate new private key
- Download JSON file
- Upload to Conduit
Device Registration
Mobile apps must register device tokens:
curl -X POST 'http://localhost:3000/pushNotifications/token' \
-H 'Authorization: Bearer USER_TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"token": "FCM_DEVICE_TOKEN",
"platform": "android"
}'
Topics
Users can subscribe to topics for group notifications:
curl -X POST 'http://localhost:3000/pushNotifications/subscribe' \
-H 'Authorization: Bearer USER_TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"topic": "news"
}'
Best Practices
- Request permission before registering tokens
- Handle token refresh on mobile apps
- Use topics for broadcast notifications
- Include data for app-specific handling