Push Notification Portal Setup
This guide covers the Telnyx portal configuration required to enable push notifications for the @telnyx/react-voice-commons-sdk.
Overview
Before your React Native application can receive push notifications for incoming calls, you need to configure push notification credentials in your Telnyx portal. This involves:
- Android: Uploading Firebase Cloud Messaging (FCM) server key
- iOS: Uploading Apple Push Notification Service (APNs) VoIP certificates
Android Setup
The Telnyx React Voice Commons SDK uses Firebase Cloud Messaging (FCM) to deliver push notifications for Android devices. To enable notifications for incoming calls on your Android mobile device, you need to set up Firebase Cloud Messaging in your application.
Prerequisites
- Firebase Project: A Firebase project with FCM enabled
- google-services.json: Downloaded from your Firebase project
- FCM Server Key: Found in your Firebase project settings
Step 1: Firebase Project Configuration
-
Create or Access Firebase Project:
- Go to Firebase Console
- Create a new project or select an existing one
- Enable Cloud Messaging in the project
-
Add Android App:
- Click "Add app" and select Android
- Enter your Android package name (e.g.,
com.yourcompany.yourapp) - Download the
google-services.jsonfile - Place the file in your project root directory
-
Get FCM Server Key:
- Go to Project Settings → Cloud Messaging
- Copy the "Server key" (legacy format)
- If legacy server key is not available, use the newer "Private key" JSON format
Step 2: Telnyx Portal Configuration
-
Access Push Credentials:
- Log in to Telnyx Portal
- Navigate to Voice → WebRTC → Push Credentials
- Click "Add Push Credential"
-
Configure Android Credential:
- Platform: Select "Android"
- Application Name: Enter a descriptive name for your app
- FCM Server Key: Paste your Firebase server key
- Package Name: Enter your Android package name (must match Firebase configuration)
-
Save Configuration:
- Click "Save" to store the credentials
- Note the credential ID for reference
Step 3: Verification
To verify your Android push notification setup:
-
Test with Firebase Console:
- Use Firebase Console → Cloud Messaging → Send test message
- Target your app and verify notifications are received
-
Test with Telnyx:
- Make a test call to your configured SIP user
- Verify that push notifications are delivered when app is in background
For detailed Firebase setup instructions, visit the Firebase Documentation.
iOS Setup
The Telnyx React Voice Commons SDK uses Apple Push Notification Service (APNs) with VoIP certificates to deliver push notifications for iOS devices. VoIP push notifications provide instant call delivery and automatic app activation.
Prerequisites
- Apple Developer Account: Active Apple Developer Program membership
- App ID: Configured with Push Notifications capability
- VoIP Certificate: Generated from Apple Developer portal
Step 1: Apple Developer Portal Configuration
-
Configure App ID:
- Go to Apple Developer Portal
- Navigate to Certificates, Identifiers & Profiles → Identifiers
- Select your App ID or create a new one
- Enable "Push Notifications" capability
- Save the configuration
-
Create VoIP Certificate:
- Navigate to Certificates, Identifiers & Profiles → Keys
- Click "+" to create a new key
- Enter a name for your key (e.g., "YourApp VoIP Push Key")
- Check "Apple Push Notifications service (APNs)"
- Click "Continue" and then "Register"
- Download the
.p8file and note the Key ID
-
Alternative - Certificate Method:
- If using certificates instead of keys:
- Navigate to Certificates, Identifiers & Profiles → Certificates
- Click "+" to create a new certificate
- Select "VoIP Services Certificate"
- Choose your App ID
- Upload a Certificate Signing Request (CSR)
- Download the generated certificate
Step 2: Telnyx Portal Configuration
Option A: Using APNs Key (Recommended)
-
Access Push Credentials:
- Log in to Telnyx Portal
- Navigate to Voice → WebRTC → Push Credentials
- Click "Add Push Credential"
-
Configure iOS Credential:
- Platform: Select "iOS"
- Application Name: Enter a descriptive name for your app
- Bundle ID: Enter your iOS bundle identifier
- APNs Key ID: Enter the Key ID from Apple Developer portal
- Team ID: Enter your Apple Developer Team ID
- APNs Key: Upload the
.p8file downloaded from Apple - Environment: Select "development" or "production"
Option B: Using APNs Certificate
-
Configure iOS Credential:
- Platform: Select "iOS"
- Application Name: Enter a descriptive name for your app
- Bundle ID: Enter your iOS bundle identifier
- APNs Certificate: Upload the VoIP certificate (
.p12or.pemformat) - Certificate Password: Enter the password if certificate is password-protected
- Environment: Select "development" or "production"
-
Save Configuration:
- Click "Save" to store the credentials
- Note the credential ID for reference
Step 3: Certificate Conversion (if needed)
If you have a .cer certificate file, you may need to convert it to .p12 format:
-
Download Certificate:
- Download the VoIP certificate from Apple Developer portal
- Double-click to install in Keychain Access
-
Export as .p12:
- Open Keychain Access
- Find your VoIP certificate
- Right-click and select "Export"
- Choose "Personal Information Exchange (.p12)" format
- Set a password (optional but recommended)
-
Convert to .pem (alternative):
# Convert .p12 to .pem
openssl pkcs12 -in certificate.p12 -out certificate.pem -nodes
Step 4: Verification
To verify your iOS push notification setup:
-
Test with Development Build:
- Build and install your app in development mode
- Ensure VoIP push notifications are properly registered
- Check device logs for push token registration
-
Test with Telnyx:
- Make a test call to your configured SIP user
- Verify that push notifications are delivered and CallKit UI appears
- Test both foreground and background scenarios
For detailed iOS push notification setup, visit the Apple Developer Documentation.
Configuration Management
Multiple Applications
If you have multiple applications (development, staging, production):
-
Create Separate Credentials:
- Create separate push credentials for each environment
- Use different bundle IDs / package names
- Use appropriate certificate environments (development/production)
-
Environment-Specific Configuration:
- Development: Use development certificates and FCM test keys
- Production: Use production certificates and production FCM keys
Credential Rotation
For security best practices:
-
Regular Rotation:
- Rotate FCM server keys and APNs certificates regularly
- Update Telnyx portal with new credentials
- Test thoroughly before deploying to production
-
Multiple Credentials:
- Telnyx supports multiple credentials per application
- Useful for gradual rollout of new certificates
- Provides fallback options during rotation
Testing and Validation
Test Scenarios
Test the following scenarios to ensure proper push notification setup:
-
App States:
- Foreground: App is active and visible
- Background: App is in background but running
- Terminated: App is completely closed
-
Network Conditions:
- WiFi connection
- Cellular connection
- Poor network conditions
-
Device States:
- Device locked vs unlocked
- Do Not Disturb mode
- Battery optimization settings
Debugging Tools
Use these tools to debug push notification issues:
-
Firebase Console (Android):
- Send test messages to verify FCM setup
- Check delivery reports and analytics
-
Apple Push Notification Tool (iOS):
- Use command-line tools to test APNs delivery
- Verify certificate validity and expiration
-
Telnyx Portal:
- Check push credential status
- Review delivery logs and error reports
Troubleshooting
Common Issues
Android Issues
Push notifications not received:
- Verify
google-services.jsonis correct and in project root - Check FCM server key in Telnyx portal
- Ensure package name matches between Firebase and Telnyx
- Verify app is not in battery optimization mode
Invalid FCM server key:
- Ensure you're using the correct server key format
- Check that FCM is enabled in Firebase project
- Verify key has not expired or been rotated
iOS Issues
VoIP push notifications not received:
- Verify VoIP certificate is uploaded correctly
- Check bundle ID matches between certificate and Telnyx portal
- Ensure certificate environment (development/production) is correct
- Verify App ID has Push Notifications capability enabled
Certificate errors:
- Check certificate expiration date
- Verify certificate is specifically for VoIP (not regular push notifications)
- Ensure certificate format is correct (.p12 or .pem)
General Issues
Credential validation failed:
- Double-check all credential details in Telnyx portal
- Verify environment settings (development vs production)
- Ensure certificates and keys are not expired
Delivery delays:
- Check network connectivity
- Verify push notification priorities are set correctly
- Review device-specific notification settings
Getting Help
If you continue to experience issues:
-
Telnyx Support:
- Contact Telnyx support with your credential ID
- Provide detailed error messages and logs
- Include test scenarios and device information
-
Platform Documentation:
Next Steps
After completing portal setup:
- App Implementation: Follow the App Setup Guide to implement push notifications in your React Native application
- Testing: Thoroughly test push notifications in all app states and scenarios
- Production Deployment: Update to production certificates and keys before deploying
- Monitoring: Implement logging and monitoring to track push notification delivery and issues