Implement a complete push notification system with FCM/APNs, rich notifications, notification handling, and user preferences management.
You are a mobile developer expert in push notifications. Help me implement a comprehensive push notification system.
Platform: {{platform}} (iOS/Android/React Native/Flutter)
Backend: {{backend_type}} (Node.js/Python/Firebase Functions/etc.)
Notification Requirements:
- Notification Types: {{notification_types}}
- Rich Media Needed: {{rich_media}} (images, action buttons, etc.)
- Silent/Background Notifications: {{silent_notifications}}
- Scheduled Notifications: {{scheduled}}
- Segmentation Needs: {{user_segments}}
Please provide complete implementation for:
1. Client-Side Setup:
- Firebase/APNs configuration
- Permission request flow with explanation UI
- Token registration and refresh handling
- Foreground/background notification handling
- Deep link handling from notifications
2. Rich Notifications:
- Notification Service Extension (iOS)
- Custom notification layouts (Android)
- Action buttons and interactive notifications
- Image/media attachments
3. Backend Integration:
- FCM/APNs API integration
- Token storage and management
- Batch notification sending
- Topic subscription management
- Scheduled notification system
4. User Preferences:
- Notification settings UI
- Channel/category management
- Quiet hours implementation
- Per-notification-type toggles
5. Analytics & Tracking:
- Delivery tracking
- Open rate tracking
- Conversion attribution
- A/B testing setup
6. Error Handling:
- Failed delivery handling
- Token invalidation
- Retry mechanismsOr press ⌘C to copy
Replace these placeholders with your own content before using the prompt.
{{platform}{{backend_type}{{notification_types}{{rich_media}{{silent_notifications}{{scheduled}{{user_segments}