Push notifications remain one of the most powerful tools for bringing users back to your app — when done right. Integrating OneSignal into a Rork-generated React Native / Expo app unlocks professional-grade segmentation, rich notifications, A/B testing, and a detailed analytics dashboard, all without building your own notification infrastructure from scratch.
OneSignal vs Expo Notifications: What's the Difference?
OneSignal is a third-party SaaS platform that manages push notifications across iOS, Android, and the web from a single dashboard. The free plan covers up to 10,000 push notifications per month — more than enough for most indie apps.
Here's how it stacks up against Expo Notifications (expo-notifications):
- Dashboard: OneSignal provides a full GUI for creating, scheduling, and reviewing notification history. With Expo Notifications, everything is code-only
- Segmentation: OneSignal lets you target users by tags, location, behavior, or last-session time through its UI. Expo Notifications requires you to implement your own filtering logic
- Rich notifications: Image cards, action buttons, and emoji titles are all configurable directly from the OneSignal dashboard
- Analytics: Delivery rate, open rate, and click-through rate are visualized out of the box
- Simplified backend: You can send notifications directly from the OneSignal dashboard or via REST API — no dedicated notification server required
If you already use Expo Notifications but want more control over who gets notified and when — or if your team's marketing person needs to send campaigns without touching code — OneSignal is an excellent upgrade.
Prerequisites: What You'll Need
Before integrating OneSignal, make sure you have:
- A Rork or Rork Max account with an active project
- A free OneSignal account
- An APNs Authentication Key for iOS (from Apple Developer Portal)
- A Firebase Service Account JSON for Android (FCM v1)
- Node.js 18 or later
To generate your APNs key, go to Apple Developer Console → Certificates, Identifiers & Profiles → Keys → Create a new key with "Apple Push Notifications service (APNs)" enabled. Download the .p8 file.
Step 1: Create a OneSignal App and Configure Platforms
Create a new app in the OneSignal dashboard
- Log in to OneSignal and click "New App/Website"
- Enter your app name and select "Mobile Push"
- Choose both iOS and Android for cross-platform coverage
iOS Configuration (APNs)
On the iOS Configuration screen:
- Authentication Type: Token (recommended over certificate)
- .p8 File: Upload your APNs key file (
AuthKey_XXXXXXXXXX.p8) - Key ID: The 10-character ID shown in Apple Developer Console
- Team ID: Your Apple Developer Team ID
Android Configuration (FCM v1)
OneSignal supports the FCM HTTP v1 API:
- Open your project in Firebase Console
- Go to Project Settings → Cloud Messaging → Firebase Cloud Messaging API (V1) → Enable
- Under Service Accounts, click "Generate new private key" and download the JSON file
- Upload this JSON file to OneSignal's Android Configuration section
After saving, OneSignal will provide you with an App ID (UUID format) and a REST API Key. Keep these handy.
Step 2: Integrate the OneSignal SDK in Your Rork App
Open your Rork project and prompt it with:
I want to add OneSignal to this project.
Please implement the following:
1. Install onesignal-expo-plugin and react-native-onesignal
2. Add the plugin configuration to app.json
3. Initialize OneSignal when the app starts
4. Add a button to request notification permission
5. Log the device push token to the console
Rork will generate the integration code, but here's what to verify manually:
app.json plugin configuration
{
"expo": {
"plugins": [
[
"onesignal-expo-plugin",
{
"mode": "production"
}
]
]
}
}OneSignal initialization code
Add this to your app entry point (App.tsx or _layout.tsx):
import OneSignal from 'react-native-onesignal';
// Call this once when the app starts
export function initOneSignal() {
// Replace YOUR_ONESIGNAL_APP_ID with your actual App ID
OneSignal.initialize('YOUR_ONESIGNAL_APP_ID');
// Request permission to send notifications (shows iOS permission dialog)
OneSignal.Notifications.requestPermission(true);
// Handle notification clicks
OneSignal.Notifications.addEventListener('click', (event) => {
console.log('Notification clicked:', event.notification);
// Add your navigation logic here
});
}
// Expected behavior:
// 1. OneSignal initializes silently at app launch
// 2. iOS shows a system permission dialog on first run
// 3. Clicking a notification logs the payload to the consoleTagging users for segmentation
Tags are key-value pairs you attach to users. They power your segmentation logic later.
import OneSignal from 'react-native-onesignal';
// Call this after a user logs in or updates their profile
export function setUserTags(userId: string, plan: 'free' | 'premium') {
OneSignal.User.addTag('user_id', userId);
OneSignal.User.addTag('plan', plan);
OneSignal.User.addTag('country', 'US');
}
// Expected behavior:
// - In the OneSignal dashboard under Audience → Segments,
// you can now create a segment like: plan = premium
// - Use this to send exclusive notifications to paying usersStep 3: Build and Test
OneSignal requires a native build — it won't work in Expo Go. You'll need an Expo Development Build or a full production build.
# Create a development build via EAS
npx eas build --platform all --profile development
# Install on a physical device and launch the app
# Your device should appear under OneSignal Dashboard → Audience → All UsersSend a test notification
- Go to OneSignal Dashboard → Messages → Push → New Push
- Select "Send to Test Device" and enter your device's player ID (logged during app init)
- Enter a title and message, then send
Step 4: Build Real Campaigns from the OneSignal Dashboard
The real power of OneSignal shows up once your users are in the system.
Segment-based targeting
Go to Audience → Segments and create conditions like:
- Premium users:
plan = premiumtag matches - Dormant users: Last Session more than 7 days ago (perfect for win-back campaigns)
- New users: Created At within the last 3 days (for onboarding sequences)
Rich notifications (image + action buttons)
Under Messages → New Push → Add Media, paste an image URL. Recommended sizes:
- iOS: 1200 × 630 px (2:1 ratio)
- Android: 1200 × 630 px or square 400 × 400 px
Intelligent Delivery
OneSignal's Intelligent Delivery automatically sends each notification at the time a user is most likely to engage, based on their past app usage patterns. Toggle it on under the Delivery section — no extra code needed.
For advanced segmentation, A/B testing, and full automation pipelines, check out the Rork Push Notification Master Plan: Segment Delivery, A/B Testing, and Automation Guide.
Common Errors and Fixes
Issue: Notifications not arriving on iOS
Cause: APNs misconfiguration or provisioning profile mismatch.
Fix: Check OneSignal Dashboard → Audience → select your device → Device Errors. If you see InvalidToken or BadDeviceToken, regenerate your APNs key and re-upload it. Also verify your EAS build's provisioning profile matches your App ID.
Issue: Notification icon appears as a white square on Android
Cause: Android notification icons must be transparent PNGs (white/gray silhouette only). Color images are ignored by the system.
Fix: In app.json, point the notification.icon field to a transparent PNG:
{
"expo": {
"notification": {
"icon": "./assets/notification-icon.png",
"color": "#4F46E5"
}
}
}Issue: App crashes in Expo Go after installing OneSignal
Cause: OneSignal uses native modules not available in Expo Go's runtime.
Fix: Use a Development Build. Run npx eas build --profile development and install the resulting .apk or .ipa on your device.
Wrapping Up
Adding OneSignal to your Rork app is one of the highest-leverage improvements you can make for long-term retention. You get a professional notification infrastructure without building or maintaining a server, a dashboard your whole team can use, and analytics to continuously improve your messaging strategy.
Start with the free tier, build your user segments with tags, and gradually introduce scheduled campaigns and Intelligent Delivery. Even small improvements to notification open rates can meaningfully boost your DAU and revenue.