Skip to main content

Prerequisites

Portal setup

React Native apps are cross-platform, so you need credentials for each platform you target:
  • Android: Follow the Android portal setup to create an Android push credential using your Firebase service account JSON.
  • iOS: Follow the iOS portal setup to create an iOS push credential using your VoIP certificate PEM files.
Attach both credentials to your SIP Connection under the WebRTC tab in the Telnyx Portal.

App setup

Install dependencies

# iOS VoIP push notifications
npm install react-native-voip-push-notification

# Expo notifications for Android FCM token (if using Expo)
npx expo install expo-notifications

Android — Firebase Cloud Messaging

1. Add the Firebase configuration file

Download google-services.json from your Firebase project console and place it in your project root (same level as package.json):
your-project/
├── google-services.json
├── package.json
├── android/
└── ios/

2. Configure the Android manifest

Add the Firebase messaging service and Telnyx notification receiver to android/app/src/main/AndroidManifest.xml:
<application>
    <service
        android:name=".AppFirebaseMessagingService"
        android:exported="false">
        <intent-filter>
            <action android:name="com.google.firebase.MESSAGING_EVENT" />
        </intent-filter>
    </service>
</application>

3. Retrieve the FCM token

The SDK handles FCM token retrieval internally on Android. Pass the token to the SDK when connecting:
import { TelnyxVoIPClient } from '@telnyx/react-voice-commons-sdk';

const client = new TelnyxVoIPClient({
    credentialConfig: {
        sipUser: 'username',
        sipPassword: 'password',
    },
});

iOS — Apple Push Notification Service

1. Configure PushKit

Use the react-native-voip-push-notification package to register for VoIP pushes and capture the device token:
import VoipPushNotification from 'react-native-voip-push-notification';

VoipPushNotification.addEventListener('register', (token: string) => {
    // Store this token — pass it to the SDK on login
    console.log('VoIP push token:', token);
});

VoipPushNotification.addEventListener(
    'notification',
    (notification: any) => {
        // Handle incoming VoIP push notification
        const metadata = notification.metadata;
        // Process the call...
    },
);

VoipPushNotification.registerVoipToken();

2. Enable capabilities in Xcode

  1. Open your iOS project in Xcode.
  2. Go to Signing & Capabilities.
  3. Add Push Notifications.
  4. Add Background Modes and enable Voice over IP.
On iOS 13.0 and later, you must report incoming VoIP push notifications to CallKit. If you fail to do so, the system will terminate your app.

Troubleshooting

Android-specific issues

  • FCM token not received: Verify google-services.json is in the correct location and the package name matches your app.
  • No notifications in background: Ensure the Firebase messaging service is declared in your Android manifest.
  • Wrong credential on SIP Connection: Check the Telnyx Portal → SIP Connection → WebRTC → Android section.

iOS-specific issues

  • No push notifications: Confirm the VoIP push certificate matches your Bundle ID and is uploaded to the Telnyx Portal.
  • App terminated on push: Report every VoIP push to CallKit on iOS 13+.
  • Environment mismatch: Use sandbox for debug builds and production for release/TestFlight.

General

  • Push works but no call invitation: The push notification signals an incoming call. Your app must reconnect to the socket after receiving the push so the SDK can receive the actual invitation.
  • Multidevice: A user can register up to 5 push tokens across iOS and Android devices.

Next steps