0
0
Fluttermobile~8 mins

Push notifications (FCM) in Flutter - Build, Publish & Deploy

Choose your learning style9 modes available
Build & Publish - Push notifications (FCM)
Performance Impact

Using Firebase Cloud Messaging (FCM) for push notifications has minimal impact on app frame rate and memory during normal use. Notifications are handled by the system in the background, so your app's UI remains smooth at 60fps. However, frequent or heavy notifications with large payloads can increase battery use and network data consumption.

Optimization Tips
  • Send lightweight notification payloads to reduce processing time.
  • Use data-only messages sparingly to avoid waking the app unnecessarily.
  • Handle notifications efficiently in background handlers to avoid blocking the main thread.
  • Batch notifications on the server side to reduce frequency.
App Size and Startup Time

Adding FCM requires including Firebase libraries, which adds about 5-10MB to your app bundle size. This is moderate and usually acceptable. Startup time impact is minimal if you initialize Firebase asynchronously and avoid blocking the UI thread during setup.

iOS vs Android Differences
  • iOS: Requires user permission to show notifications. You must configure APNs certificates and enable push capabilities in Xcode.
  • Android: Uses Firebase directly with Google Play services. Runtime permission required for notifications on Android 13 (API 33) and higher.
  • Notification appearance and behavior differ by platform and OS version.
  • Background message handling requires different setup: iOS uses didReceiveRemoteNotification, Android uses background message handlers.
Store Review Guidelines
  • Apple App Store: Must request user permission before sending notifications. Follow Apple's Human Interface Guidelines for notification content and frequency.
  • Google Play Store: Ensure notifications respect user privacy and do not spam users.
  • Both stores require clear privacy policies explaining notification use.
  • Do not use notifications for advertising without user consent.
Self-Check

Your app takes 5 seconds to load this screen. What's likely wrong?

  • Firebase initialization is blocking the main thread during startup.
  • Heavy or synchronous notification handling code delaying UI rendering.
  • Large notification payloads causing slow processing.
  • Network delays due to poor connectivity or inefficient message handling.
Key Result
FCM push notifications add moderate bundle size but minimal UI impact. Optimize payload size and background handling for smooth 60fps performance. Follow platform-specific setup and store guidelines for permissions and privacy.