cyberneticlibrary

Send push notifications cross-platform

firebase-messagingskillsetup L2548
evanca/flutter-ai-rules
What it does

Implement push notifications via Firebase Cloud Messaging

Best for

Sending cross-platform push notifications with reliable foreground, background, and terminated-state handling.

Inputs
  • · Firebase messaging setup
  • · APNs key (iOS)
  • · Background handler
  • · Push payload
Outputs
  • · FCM token registered
  • · Foreground/background handlers active
  • · Web service worker configured
Requires
  • · Firebase Cloud Messaging
  • · APNs (Apple)
  • · Google Play services (Android)
  • · Service worker for web
Preconditions
  • · Firebase project with APNs key uploaded
  • · iOS method swizzling enabled
  • · Android 4.4+ with Google Play services
  • · Web: service worker file at web/firebase-messaging-sw.js
Failure modes
  • · APNs auth key bundle ID mismatch causes iOS failures
  • · Background handler must be top-level (not class method)
  • · Service worker registration fails silently on web
  • · Token refresh listeners miss edge cases on network interruption
Trust signals
  • · Top-level background handler with @pragma example
  • · DebugView verification for message delivery
  • · APNs setup checklist
  • · Permission API examples for iOS 12.2+ (provisional key)