How Push Notifications Work with Dialect
1
Users subscribe
Please note that it is requried to subscribe your user to the basic alerts endpoint as well to ensure push notifications are delivered.
2
Dialect routes notifications
If event occurs, Dialect sends notifications to subscribed users and triggers the send process
3
Firebase Cloud Messaging (FCM) sends notifications
Firebase handles device token management and delivers push notifications to the user’s device
Prerequisites
Before implementing push notifications with Dialect, please ensure you have completed the following steps:- App Registration: Your app must be registered with Dialect (registration guide)
- User Authentication: Users must be authenticated with JWT tokens (authentication guide)
- Set up Firebase Cloud Messaging in your application
- Follow Firebase’s documentation to add the Firebase SDK to your app
- Implement the necessary code to request and receive an FCM token
- Implement wallet integration for Solana signature verification
- Your mobile app must be able to request message signing from the user’s wallet
- Provide Service Account Credentials to Dialect for authentication
- Dialect uses your service account credentials to authenticate and send push notifications to your users
- To get started, create a service account with the
cloudmessaging.messages.createrights - Once created, contact us at hello@dialect.to to provide your service account credentials
- Dialect will then connect your app with our Alerts infrastructure
Push Subscription Flow
Once a user is authenticated, you can register their device to receive push notifications. This involves obtaining an FCM token and associating it with the user’s wallet address.Get FCM Token
Before you can subscribe to push notifications, you need to obtain an FCM token from Firebase:- React Native
- iOS (Swift)
- Android (Kotlin)
- Web
Push Subscription Management
Subscribe to Push Notifications
Once you have an FCM token, subscribe the user to push notifications:fcmToken: Firebase Cloud Messaging token from your mobile appdeviceId: (Optional) Unique device identifier for managing devicesappId: (Optional) Subscribe to pushes for specific app only
Unsubscribe from Push Notifications
Handling Push Notifications
Processing Received Notifications
- React Native
- iOS (Swift)
- Android (Kotlin)
Push Notification Data Structure
Dialect push notifications include standard notification content plus custom data:Advanced Configuration
App-Specific Push Subscriptions
Subscribe to push notifications for specific apps only:Notification Categories and Topics
Push notifications respect user subscription preferences:- Channel subscriptions: Users must be subscribed to apps via channels (IN_APP, EMAIL, etc.)
- Topic subscriptions: If your app uses topics, push notifications will only be sent for subscribed topics
- Push preference: Users must specifically enable push notifications
Custom Push Behavior
Configure push notification behavior:Troubleshooting
Common Issues
Push notifications not received:- Verify FCM token is valid and current
- Check if user is subscribed to push notifications via Dialect
- Ensure app has notification permissions
- Verify Firebase project configuration
- Ensure JWT token is valid and not expired
- Verify client key is correct
- Check if user has proper permissions
- Verify APNs certificate is properly configured in Firebase
- Check iOS notification permissions
- Ensure app is properly signed for push notifications
Best Practices
Next Steps
With push notifications integrated, you have a complete notification system:- User Management - Manage user subscriptions and preferences
- Notification History - Retrieve and display notification history
- Authentication - Handle user authentication flows