Push notifications are the most direct channel for re-engaging mobile app users, but they are also the fastest way to drive uninstalls when implemented poorly. Effective push notification systems require both solid technical infrastructure—Firebase Cloud Messaging (FCM) for Android and Apple Push Notification service (APNs) for iOS—and a thoughtful engagement strategy that respects user attention. This article covers both dimensions.
FCM and APNs: Server-Side Setup
Firebase Cloud Messaging serves as the unified messaging layer for both Android and iOS (via APNs proxy). On the server side, initialize the Firebase Admin SDK with your service account credentials. The Admin SDK handles token management, topic subscription, and message delivery to individual devices or user segments.
For direct APNs integration (useful when you need features beyond what FCM proxies), configure your APNs authentication key or certificate in your server environment. Token-based authentication using a .p8 key file is recommended over certificate-based authentication because tokens do not expire annually and work for both development and production environments.
Message payloads differ between platforms. Android notifications can include a notification payload (handled by the system when the app is in background) and a data payload (always delivered to the app for custom handling). iOS notifications must conform to APNs payload structure with the aps dictionary containing alert, badge, and sound fields. When using FCM, platform-specific configurations can be specified in the android and apns fields of the message object.
Client-Side Implementation
On the client, request notification permission early enough to be useful but late enough that users understand the value. A common pattern is to prompt after the user completes a meaningful action—placing an order, adding items to a wishlist, or completing onboarding. Pre-permission screens that explain what notifications the user will receive significantly improve opt-in rates.
Handle device token registration carefully. Tokens can change when the app is reinstalled, restored from backup, or updated. Register the token on every app launch, associating it with the authenticated user ID on your server. Implement token cleanup to remove stale tokens that return errors from FCM or APNs—this improves delivery metrics and reduces unnecessary API calls.
Notification handling varies by app state. When the app is in the foreground, you receive the notification in your app code and can display a custom in-app alert. When the app is in the background or terminated, the system displays the notification, and tapping it launches the app with the notification payload available for deep linking.
User Segmentation
Broadcasting identical notifications to all users is a recipe for high opt-out rates. Segment users based on behavior (active, lapsed, power users), demographics (location, language), preferences (selected categories, notification settings), and lifecycle stage (new user, returning, at-risk of churning).
In Bangladesh, language segmentation is particularly important—notifications in Bangla see substantially higher engagement rates than English-only content for consumer applications. Time zone handling is straightforward with a single-timezone market but consider prayer times and cultural events when scheduling notifications for maximum receptivity.
FCM topics provide server-side segmentation without managing individual tokens. Subscribe users to topics like "promotions_dhaka" or "category_electronics," and send messages to entire topics efficiently. For more granular targeting, FCM conditions allow combining up to five topics with boolean logic.
A/B Testing Notifications
Test notification variants systematically to optimize open rates and conversion. Vary the title, body text, send time, and deep link destination independently. Firebase A/B Testing integrates directly with FCM, allowing you to define experiments, split audiences, and measure results without custom infrastructure.
Key metrics to track include delivery rate (messages successfully delivered divided by messages sent), open rate (notifications tapped divided by delivered), conversion rate (desired action completed after opening), and opt-out rate (users disabling notifications after receiving the message). A notification that achieves high open rates but also drives opt-outs is a net negative.
Scheduling and Frequency
Notification fatigue is real. Establish frequency caps—no more than one promotional notification per day and no more than three to five per week as a general guideline. Transactional notifications (order updates, payment confirmations, security alerts) should not be subject to frequency caps but should still be concise and actionable.
Optimal send times vary by user segment. Analyze your own engagement data to identify peak receptivity windows. In the Bangladeshi market, evening hours (7 PM to 10 PM BST) generally yield the highest engagement for consumer applications, while business applications see better results during working hours.
Implement quiet hours to suppress non-urgent notifications during sleeping hours (typically 11 PM to 7 AM). Either enforce this server-side or leverage the device's Do Not Disturb settings through platform APIs.
Notification Strategy at Nexis Limited
We design push notification systems that drive engagement without alienating users. Our mobile development services include notification infrastructure setup, segmentation strategy, and A/B testing frameworks. Contact us to build a notification system that your users actually appreciate.