Skip to main content
Use the Sendrealm React Native SDK in Expo apps that can include native code. That means Expo prebuild, expo run, EAS development builds, and production builds. Expo Go is not supported because mobile push requires native code. If your React Native app already owns native android and ios projects without Expo prebuild, use React Native Bare SDK.

Requirements

  • Expo project using development builds or prebuild.
  • Android device or emulator with Google Play services.
  • Physical iOS device for APNs testing.
  • A Sendrealm app ID from the dashboard.
  • Firebase credentials uploaded for Android delivery.
  • APNs credentials uploaded for iOS delivery.
  • Push Notifications enabled for the iOS Bundle ID in Apple Developer.

Setup Order

  1. Upload Firebase and APNs credentials in Sendrealm.
  2. Install @sendrealm/react-native.
  3. Add the Sendrealm Expo plugin to app.json or app.config.js.
  4. Add Android google-services.json.
  5. Configure iOS push capabilities.
  6. Run Expo prebuild or create an EAS build.
  7. Initialize Sendrealm from JavaScript.
  8. Ask for notification permission after explaining the value to the user.
  9. Call login when the user signs in.
  10. Send test pushes on Android and iOS.

Install

Configure The Plugin

Add the Sendrealm plugin to app.json or app.config.js:
Do not put Sendrealm API keys, Firebase service account JSON, or APNs .p8 files in Expo config. Provider private keys belong in the Sendrealm dashboard.

Android Setup

Generate google-services.json from Firebase and save it in your Expo project. Point the plugin at the file:
During prebuild, the plugin copies it into the Android app. Make sure the Firebase Android package name matches the package Expo builds, usually expo.android.package.

iOS Setup

In Apple Developer:
  1. Open Certificates, Identifiers & Profiles.
  2. Open Identifiers.
  3. Select the App ID for the Bundle ID in your Expo config.
  4. Enable Push Notifications.
  5. Save the App ID changes.
In Expo config:
  • Set ios.apnsEnvironment to sandbox for development builds or production for TestFlight and App Store builds.
  • Set ios.enableBackgroundRemoteNotifications to true only if you send silent/background pushes.
  • Set ios.notificationServiceExtension to true if you send rich image notifications.
Then rerun prebuild or create a new EAS build. See Mobile Push Credentials for Firebase and APNs setup.

Prebuild And Run

Generate native projects and run locally:
Use --device for iOS push testing.

Build With EAS

Build development clients with EAS:

Initialize

Read values from Expo config and initialize once:
Use production for production-targeted app builds. Most apps should keep autoRequestPermission: false and ask permission after an in-app explanation.

Ask For Permission

Check status:

Tags And Events

Use tags for app-observed preferences, state, and behavior:
Track app events:
Call login before setting user tags.

Rich iOS Media

Rich image notifications require a Notification Service Extension. Enable it in the plugin:
Then rerun prebuild or create a new EAS build.

Android Notification Icons

Android status bar icons should be simple drawable resources, usually monochrome. If you set:
The native Android project must contain a matching drawable resource such as res/drawable/ic_stat_sendrealm.xml.

Diagnostics

Use support diagnostics while testing:
Confirm diagnostics show:
  • A device ID.
  • Token presence.
  • Expected permission status.
  • Subscribed state unless the user opted out.
  • SDK version.
  • No unexpected SDK error.

Troubleshooting