> ## Documentation Index
> Fetch the complete documentation index at: https://developers.telnyx.com/llms.txt
> Use this file to discover all available pages before exploring further.

# React Native Push Notifications

> Configure push notifications for the Telnyx React Native Voice SDK on both Android and iOS.

## Prerequisites

* A [Telnyx account](https://portal.telnyx.com) with a configured SIP Connection
* The `@telnyx/react-voice-commons-sdk` integrated into your application
* **Android**: A [Firebase project](https://console.firebase.google.com/) with Cloud Messaging enabled
* **iOS**: An [Apple Developer account](https://developer.apple.com/) with a VoIP push certificate

## Portal setup

React Native apps are cross-platform, so you need credentials for each platform you target:

* **Android**: Follow the [Android portal setup](/docs/voice/webrtc/push-notifications/android#portal-setup) to create an Android push credential using your Firebase service account JSON.
* **iOS**: Follow the [iOS portal setup](/docs/voice/webrtc/push-notifications/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

```bash theme={null}
# 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`:

```xml theme={null}
<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:

```typescript theme={null}
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:

```typescript theme={null}
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**.

<Callout type="warning">
  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.
</Callout>

***

## 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

* [Push notifications overview](/docs/voice/webrtc/push-notifications) — Multidevice support and architecture
* [React Native SDK reference](/development/webrtc/react-native-sdk) — Full SDK documentation
* [Mobile Push Credentials API](/api/webrtc/mobile-push-credentials) — Manage credentials programmatically
