React Native Integration
Choose your AlgorithmX setup: Expo, React Native Firebase, or existing native push. Share customers, events, and navigation in JavaScript.
React Native SDK 1.1.1: uses native SDKs 1.1.0 and FCM tokens on both platforms. The optional Firebase adapter now registers current and refreshed iOS FCM tokens as well as Android tokens.
Start with the setup your app already uses. AlgorithmX runs through one React Native SDK on Android and iOS. Customer identity, business events, custom actions, and campaign navigation stay in JavaScript.
These guides use the current general-event contract at POST /api/v1/Event/Log. No-argument init(), native push helpers, and API-based in-app views remain available. Install 1.1.1 or later for the Firebase adapter behavior described here, then rebuild the native app.
What you will do
First, connect the SDK to your app's startup and notification setup. Then tell it who is using the app, send a few useful events, and connect campaign actions to your existing screens. Finish by sending a test campaign to a real phone.
The setup table below is a choice of routes, not a list of tasks to complete. Find the row that describes your app and follow only that route. If you are unsure which push library you use, check your app's dependencies with the developer who maintains notifications.
Choose your setup
| Your app | Follow this path | Native work |
|---|---|---|
| Expo SDK 55 with Expo Notifications | Expo setup and iOS FCM limitation, then shared JavaScript | Plugin startup supports API-based in-app campaigns. Automatic iOS token registration remains APNs and needs a different integration for FCM push. |
React Native with @react-native-firebase/messaging | Install and start, Firebase adapter, iOS push, then shared JavaScript | The adapter registers FCM tokens on both platforms. Android message forwarding stays in JavaScript; iOS notifications use native callbacks. |
| React Native with its own Android messaging service | Install and start, Android native push, iOS push, then shared JavaScript | Native startup and small forwarding helpers in your existing handlers. |
| Expo with React Native Firebase or a custom native push handler | Use the React Native path matching your push library | Preserve those native changes with your existing config plugin. The AlgorithmX Expo Notifications plugin is a separate choice. |
| React Native Web / browser app | Browser support is still being assessed | This package requires native modules and does not provide browser push. |
Pick one Android push route. Installing two services or forwarding the same message twice can display duplicate notifications. Both platforms register FCM tokens with AlgorithmX. iOS delivery still uses native Apple callbacks after Firebase forwards through APNs.
Using Expo Notifications? The plugin can generate SDK startup for API-based in-app campaigns. Its automatic iOS APNs-token registration is not compatible with the FCM-only sender. Use the Firebase/native path for iOS push and preserve the resulting native configuration through your own Expo config plugin. Customer identity and campaign navigation still belong in JavaScript.
Managing native projects yourself? Add the small native startup and push calls in the linked React Native guides. They let a notification reach AlgorithmX even when it starts the app before JavaScript is ready.
Before the client meeting
You can save time by answering these four questions together before changing the app:
- Does the app use Expo, React Native without Expo, or a browser target? Which versions?
- Which library or native service owns push notifications today?
- Which customer ID, events, custom actions, and links should campaigns use?
- Who configures Firebase, uploads the service-account JSON to AlgorithmX, and configures Apple's APNs credentials in Firebase?
You do not need a new native implementation for every action or deep link. Give the campaign team the actions and routes your app supports, and handle their callbacks in JavaScript. External links that launch the app also need the app's normal platform link configuration.
What the SDK automates
The React Native package autolinks its bridge, forwards and buffers SDK callbacks, and manages in-app campaign display. The optional Firebase adapter handles current/refreshed FCM tokens on iOS and Android, and foreground message forwarding on Android. It keeps iOS notification processing native.
The client supplies their API base URL and partner ID once per native platform, or once in Expo configuration. JavaScript uses AlgorithmX.init() to connect to that configuration. Early native startup matters because a push can launch the process before JavaScript runs.
The app controls login, permission timing, navigation, Firebase configuration, Apple signing, and notification delegates. Optional iOS rich-notification setup is separate from the basic integration.
Requirements
- Android API 24 or later; iOS 15.1 or later.
- API base URL and partner ID from AlgorithmX. SDK requests include
x-partner-id. - Firebase Cloud Messaging on both platforms. Keep the separate Android/iOS client configuration files in their apps and upload one service-account JSON for the project to AlgorithmX. Configure Apple's APNs credentials in Firebase. See Connect Firebase and Send a Test.
- A native app rebuild after installation or configuration changes. Expo Go cannot load the SDK.
After setup, complete the device test checklist before releasing.
