Android Push (FCM)
The Firebase Cloud Messaging HTTP v1 channel — service account, data-only message model, Android content fields, notification channels, delivery feedback and troubleshooting.
Android push is sent through the FCM HTTP v1 API using a Firebase service account. Pushizo always sends data-only messages; the notification is built on the device by the Android SDK. This keeps click/delivery feedback, rich content and action buttons consistent even when the app is in the background. For Huawei devices, see the HMS channel. Setup: Android quickstart.
Credentials
Use the JSON file downloaded from Firebase → Project settings → Service accounts → Generate new private key. In the dashboard, go to Channels → Android Push → upload the file → Validate. API: PUT /v1/apps/{app_id}/channels/android_push { "provider": "fcm", "config": { "service_account": { …json… } } } (a multipart file upload is also accepted). Validation obtains an OAuth token from FCM and checks project access; token_uri is accepted only on Google domains (SSRF protection).
Content fields
| Field | Behavior |
|---|---|
headings, contents, url | Title, body and click URL |
android_channel_id | Notification channel (Android 8+). If missing, the SDK uses the default channel (defaultChannelName) |
android_group | Grouping key |
android_sound | Sound file name in res/raw |
small_icon, large_icon | Status bar icon (drawable name) and large icon (URL or drawable) |
android_accent_color | #RRGGBB accent color |
android_visibility | 1 public, 0 private, -1 secret (lock screen) |
big_picture | Big picture style |
buttons | [{ id, text, icon? }] action buttons |
collapse_id | FCM collapse_key (the same key replaces the previous notification) |
priority (5/10) | FCM normal / high priority; 10 wakes the device from Doze mode |
ttl | FCM ttl (seconds, up to 28 days) |
data | Custom payload; the SDK exposes it via notification.additionalData |
Notification channels are defined in the dashboard under Channels → Android Push → Notification channels (name, importance, sound, vibration); the SDK creates them on the device at first launch (Android SDK → notification channels).
Delivery and feedback
- FCM response:
200→sent;UNREGISTERED/INVALID_ARGUMENT(token) → subscriptioninvalid+subscription.invalidated;QUOTA_EXCEEDED/UNAVAILABLE/5xx→ retry schedule. - The SDK reports
receivedwhen it displays the notification andopenedwhen it is tapped; to comply with the Android 12+ "trampoline" restriction, the SDK uses an explicitPendingIntent. - Token changes (
onNewToken) are written to the subscription automatically by the SDK.
Troubleshooting
| Symptom | Check |
|---|---|
Validation returns 403 | Is the service account's project the same as the app's google-services.json project? Is the Firebase Cloud Messaging API (V1) enabled? |
| Notifications not arriving (Android 13+) | Has the POST_NOTIFICATIONS permission been granted (Pushizo.Notifications.permission)? |
| Notifications not arriving (some devices) | Manufacturer battery optimization (Xiaomi, Huawei EMUI); try priority: 10; use HMS on Huawei |
| Icon shows as a white square | small_icon must be monochrome with a transparent background |
Tap opens the app but there is no url | Read event.url with addClickListener; check the Activity launchMode |
iOS Push (APNs)
The APNs channel — .p8/.p12 credentials, sandbox/production environments, iOS content fields, badge/sound/category, Notification Service Extension and troubleshooting.
Notifications to Huawei devices (HMS Push Kit)
Huawei devices without Google Play Services cannot receive Firebase (FCM) notifications. Pushizo sends to these devices through Huawei Push Kit with the hms_push channel…