Real-time ride alerts via Firebase Cloud Messaging. Driver assignment notifications, promotional campaigns, topic-based messaging, and notification analytics across iOS and Android from a single backend integration.
Firebase Cloud Messaging (FCM) is the backbone of real-time push notifications in your taxi app. Unlike SMS which costs $0.01-0.07 per message, FCM delivers unlimited push notifications at zero cost. For a platform sending 15-20 notifications per ride across rider and driver apps, this eliminates thousands of dollars in monthly communication costs.
Our integration uses FCM for all time-sensitive ride events: new ride requests to drivers, ride acceptance confirmations to riders, driver-arriving alerts, trip-started/completed notifications, and payment receipts. Each notification is delivered in under 250 milliseconds, ensuring riders and drivers always have the latest ride status.
Beyond transactional ride notifications, FCM powers your marketing engine with topic-based campaigns, geo-targeted promotions, and re-engagement notifications for inactive riders. The admin dashboard provides a no-code campaign builder where you can schedule and segment push notifications without developer involvement.
The platform uses FCM's Admin SDK on the server side to send targeted notifications. Each user's FCM device token is stored and refreshed automatically. The system supports both notification messages (displayed by the OS) and data messages (handled by the app in foreground and background).
// Send ride request to driver with high priority
const sendRideRequest = async (driver, ride) => {
const message = {
token: driver.fcmToken,
data: {
type: 'RIDE_REQUEST',
ride_id: ride.id,
pickup_lat: String(ride.pickup.lat),
pickup_lng: String(ride.pickup.lng),
pickup_address: ride.pickup.address,
fare_estimate: String(ride.fareEstimate),
vehicle_type: ride.vehicleType,
expires_at: String(Date.now() + 15000)
},
android: {
priority: 'high',
ttl: 15000,
notification: {
channelId: 'ride_requests',
sound: 'ride_alert.mp3',
priority: 'max'
}
},
apns: {
headers: { 'apns-priority': '10' },
payload: {
aps: {
sound: 'ride_alert.caf',
'content-available': 1,
'interruption-level': 'time-sensitive'
}
}
}
};
return admin.messaging().send(message);
};
// Send surge pricing alert to riders in a specific city
const sendSurgeAlert = async (city, surgeMultiplier) => {
return admin.messaging().send({
topic: `riders_${city.toLowerCase()}`,
notification: {
title: `Demand is high in ${city}`,
body: `Fares are ${surgeMultiplier}x right now. Book now or wait for prices to drop.`
},
data: { type: 'SURGE_ALERT', multiplier: String(surgeMultiplier) }
});
};
Driver ride requests use FCM high-priority with iOS time-sensitive interruption level. The notification breaks through Do Not Disturb and Focus modes, ensuring drivers never miss a ride request even when their phone is locked.
When a driver accepts a ride, the rider receives an instant push with driver name, photo, vehicle model, license plate, and ETA. Tapping the notification opens the app directly to the live tracking screen.
Admin dashboard campaign builder lets you create, schedule, and send promotional push notifications to segmented user groups. Target by city, ride frequency, last-active date, preferred vehicle type, or custom attributes.
Users auto-subscribe to topics based on their city, language, and user type (rider/driver). Send city-wide service updates, weather alerts, or surge notifications to thousands of users with a single API call.
Android notification channels separate ride alerts (high priority, custom sound) from promotions (normal priority, default sound). Riders control which notification types they receive without affecting critical ride updates.
FCM data messages silently update the app in the background: refresh ride status, sync driver location, update fare calculations, and pull new configuration without displaying a visible notification to the user.
Create a Firebase project in the Firebase Console. Register both iOS and Android apps with their respective bundle IDs and package names. Download google-services.json (Android) and GoogleService-Info.plist (iOS).
Upload your Apple Push Notification service (APNs) authentication key (.p8 file) to Firebase. This enables FCM to deliver notifications to iOS devices through Apple's push infrastructure.
Generate a Firebase Admin SDK service account key and upload it to the admin dashboard. This key authenticates your backend to send notifications via the FCM Admin SDK.
Customize notification titles, body text, sounds, and deep links for each ride event in the admin panel. Set Android notification channels and iOS category identifiers for actionable notifications.
Send test notifications to specific device tokens from the admin dashboard. Verify delivery on both iOS and Android, including background delivery, notification sounds, and deep link handling.
Track delivery rates, open rates, and conversion for every notification type. Optimize timing, content, and segmentation to maximize rider engagement.
Track per-notification delivery status: sent, delivered, opened, and dismissed. Identify device types and OS versions with lower delivery rates to troubleshoot platform-specific issues.
Per-message trackingMarketing push campaigns show open rate, click-through rate, and ride conversion rate. A/B test notification copy and timing to identify what drives the most re-bookings.
A/B testingFCM tokens expire when users uninstall or reinstall the app. The system automatically removes stale tokens and updates new ones, keeping the device registry clean and delivery rates high.
Auto-cleanupPrevent notification fatigue by limiting promotional pushes to 2 per day per user. Critical ride notifications bypass rate limits. Users who disable promotions still receive ride alerts.
Smart throttlingCampaign notifications are delivered at optimal local times based on each user's timezone. A "10 AM delivery" reaches New York riders at 10 AM ET and London riders at 10 AM GMT.
Local time deliveryIf FCM delivery fails (app uninstalled, token expired, device offline for 24+ hours), the system falls back to SMS via Twilio for critical notifications like ride confirmations and receipts.
Guaranteed deliveryFCM is completely free regardless of volume. A platform sending 1 million notifications daily pays nothing for push delivery, compared to $7,900/day for equivalent SMS volume at US rates.
FCM delivers notifications in under 250ms on average. For ride requests to drivers, this speed difference determines whether your driver accepts before a competitor's notification arrives.
Targeted push campaigns bring inactive riders back. "We miss you" notifications with discount codes reactivate 8-12% of dormant users, directly increasing monthly active riders.
One FCM integration covers iOS, Android, and web. Send the same notification to all platforms with platform-specific customization (sounds, channels, actions) handled automatically.
Include images, action buttons, and deep links in notifications. A "Rate your ride" notification includes star rating buttons directly in the notification shade, no app open required.
FCM runs on Google's global infrastructure with 99.95% uptime. Handles any scale from 100 to 100 million daily notifications without capacity planning or infrastructure management.
Yes. FCM is completely free with no message limits, no per-message charges, and no monthly fees regardless of volume. Google funds FCM as part of the Firebase platform. The only cost is the Firebase project itself, which is free for the features used in push notification delivery.
On Android, high-priority FCM messages wake the app even when it is killed or the device is in Doze mode. On iOS, notifications are delivered by APNs and displayed by the OS even when the app is not running. The app processes the notification data when the user taps on it. Both platforms reliably deliver ride-critical notifications.
Yes. The admin dashboard includes a campaign builder where you can compose notifications, select target audiences (all riders, specific cities, inactive users, etc.), schedule delivery times, and track results. No coding required. Campaigns can be saved as templates for recurring use.
FCM tokens can expire when users reinstall the app, clear app data, or restore to a new device. The app automatically registers a new token on launch and updates the backend. Stale tokens that receive NotRegistered errors from FCM are automatically removed from the database. For critical notifications to users with expired tokens, the system falls back to SMS.
Yes. Ride requests are sent as high-priority data messages that wake the app on Android. On iOS, the notification uses time-sensitive interruption level and content-available flag to trigger background processing. The driver sees a full-screen ride request overlay with accept/decline buttons, even from the lock screen, with a custom alert sound.
Real-time ride alerts, driver assignment notifications, promotional campaigns. Free, fast, and cross-platform push notifications for your ride-hailing business.