Skip to main content
The Courier React Native SDK gives you prebuilt components and TypeScript APIs. It handles authentication, token management, and real-time delivery on iOS and Android. This page is the React Native reference: what to install, how to configure both native projects, and the TypeScript API surface. Each flow is written once and applies to every platform. Available on GitHub and npm.

Installation

iOS setup

1

Install the pods

In React Native’s Swift Package Manager mode (0.87 and later), skip this step. npx react-native spm picks up the package instead.
2

Forward the APNs callbacks

In your Swift AppDelegate, hold a CourierDelegate and forward the registration callbacks to it. This is what syncs the token. CourierDelegate isn’t part of the package. Copy CourierDelegate.swift from the example app into your iOS project.
Keep these callbacks in AppDelegate even if your app starts React Native from a SceneDelegate, as the React Native 0.88 template does. APNs delivers the token to the application, not to a scene. The iOS 27 SDK requires the scene life cycle, and the example app’s SceneDelegate shows the split.An older app with an Objective-C AppDelegate inherits from CourierReactNativeDelegate instead. On Expo, see Expo below.
If your Podfile uses use_frameworks!, import it by module name instead: #import <courier_react_native/CourierReactNativeDelegate.h>.

Android setup

1

Add the Jitpack repository

In your android/build.gradle:
2

Set minimum SDK version

In your android/build.gradle:
3

Extend CourierReactNativeActivity

Update your MainActivity to extend CourierReactNativeActivity. This lets the SDK manage user state across app sessions.
4

Use a Material theme

The prebuilt inbox and preference center only render correctly when your app theme extends Theme.MaterialComponents. Set it in res/values/styles.xml.

Authentication

Courier authenticates with a JWT that your backend mints with your Courier API key, never in client code. Authenticate users covers the token flow, scope strings, reading auth state, signing out, and token refresh. Using the EU datacenter? See EU setup. Credentials persist across app sessions, so you sign in once per user rather than on every launch.

Inbox

Add an inbox is the setup flow. These are the types it uses on React Native. Every callback and action these expose is documented per platform in Data and actions.

Inbox theme

The theme prop takes a CourierInboxTheme for light mode and one for dark mode. The inbox picks the one that matches the system appearance. Most fields apply on both platforms. Only a few platform-specific options go under iOS and android. Leave out any field to keep its default.
Fonts resolve differently on each platform. On iOS family is a font name. On Android it’s a path to a font in your assets.

Background colors

The inbox has three background colors, and each defaults to the system background. Setting backgroundColor alone leaves the rows and tabs at their defaults. For a dark inbox, set all three, and set text colors that read on a dark background. Use the same theme for both modes to keep the inbox dark when the device is in light mode.
Default Inbox on iOSDefault Inbox on Android

Default Inbox on iOS and Android

Styled Inbox on iOSStyled Inbox on Android

Styled Inbox on iOS and Android

Branding from Courier Studio also applies. The SDK reads your brand’s primary color.

Push notifications

Set up push notifications is the setup flow, from connecting APNs and FCM to a device that receives push. It covers the native wiring above, setTokenForProvider, permission, and reading the payload on tap.
Push notifications require a physical device. Simulators and emulators don’t reliably support push token registration or notification delivery.
Two things live only here. On Android, forward both FirebaseMessagingService callbacks to Courier.Companion.onMessageReceived and Courier.Companion.onNewToken. On iOS, add a Notification Service Extension to track delivery while your app is closed.

Expo

Expo manages AppDelegate (iOS) and MainActivity (Android) itself, so the subclassing above doesn’t apply. The Expo example app (Expo SDK 58) shows the wiring:
  • iOS: its AppDelegate extends ExpoAppDelegate, holds a CourierExpoDelegate, and forwards the APNs token to it.
  • Android: its ExampleService forwards the FirebaseMessagingService callbacks, and the app depends on com.google.firebase:firebase-messaging.

Preferences

Add a preference center is the setup flow. These are the types it uses on React Native.
Topics and sections are configured in the Preferences Editor. See Preferences Overview for how preference enforcement works at send time.

Preferences theme

The theme prop works like the inbox one: a CourierPreferencesTheme for light and for dark, with shared fields at the top level and platform-specific options under iOS and android. Courier Studio branding applies automatically when you supply a brandId.

Default Preferences on iOS and Android

Styled Preferences on iOS and Android

CourierClient

For advanced use cases, CourierClient is a low-level wrapper around the Courier API. Each client holds its own credentials, so you can spin up as many as you need.

Initialization

Token management

Inbox

Preferences

Branding

URL tracking

Pass any tracking URL found inside a push notification payload or inbox message:
See the full Courier API reference at courier.com/docs/reference.