Prerequisites
- A Telnyx account with a configured SIP Connection
- A Firebase project with Cloud Messaging enabled
- The Telnyx Android WebRTC SDK integrated into your application
Portal setup
1. Configure Firebase Cloud Messaging
- Go to the Firebase Console and open your project.
- Navigate to Project Overview → Project Settings → Service Accounts.
- Select Generate New Private Key to download a service account JSON file.
The Firebase Cloud Messaging HTTP v1 API uses a service account JSON key, not the legacy server key. Make sure you download the full service account JSON file.
2. Create an Android push credential in the Telnyx Portal
- Go to portal.telnyx.com and log in.
- Navigate to API Keys in the left panel.
- Select the Credentials tab, then click Add → Android Credential.
- Enter a credential name and paste the contents of the service account JSON file into the Project Account JSON field.
- Click Add Push Credential to save.
3. Attach the credential to a SIP Connection
- Navigate to SIP Connections in the left panel.
- Open the SIP Connection you want to configure (or create a new one).
- Select the WebRTC tab.
- In the Android section, select the push credential you created.
- Save the SIP Connection.
App setup
Retrieve the FCM token
After integrating Firebase into your Android application (Firebase setup guide), retrieve the FCM registration token:Pass the token to the SDK
Provide the FCM token when connecting theTelnyxClient. The SDK registers it with Telnyx so push notifications can be routed to this device.
Handle incoming push notifications
Create aFirebaseMessagingService to process incoming FCM messages. Parse the metadata field from the notification payload and pass it to your notification UI:
Decline calls from push notifications
The SDK providesconnectWithDeclinePush() to decline incoming calls without fully reconnecting:
decline_push: true parameter, handles the decline, and disconnects automatically.
Android 14 permissions
Android 14 requires explicit notification permissions. Add these to yourAndroidManifest.xml:
POST_NOTIFICATIONS at runtime before showing notifications.
Troubleshooting
FCM token not passed to login
Verify that the FCM token is retrieved successfully and included in theCredentialConfig or TokenConfig passed to connect(). Check your logs for the token value.
Incorrect google-services.json
Confirm that thegoogle-services.json file is in your app module’s root directory and the package name matches your application.
Wrong push credential on the SIP Connection
In the Telnyx Portal, open your SIP Connection → WebRTC tab → Android section and verify the correct credential is selected.Invalid push credential
If the service account JSON is malformed or from the wrong Firebase project, push delivery fails silently. Generate a fresh key from the Firebase Console and update the credential in the Portal.Testing push delivery
The SDK repository includes a testing tool in thepush-notification-tool/ directory that sends test FCM notifications to verify your setup independently of the Telnyx call flow:
Next steps
- Push notifications overview — Multidevice support and architecture
- Android SDK reference — Full SDK documentation
- Mobile Push Credentials API — Manage credentials programmatically