Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4133 pages

APIs and integrations

FCM vs APNs: Payload Size, Priority, Expiry and Collapsing

In short

FCM vs APNs matters most for a phone that is offline: FCM can hold several pending messages for up to 28 days, while APNs stores just one notification per app for up to 30. Both cap payloads at 4,096 bytes, APNs allows 5,120 for VoIP, and FCM sends to iPhones through APNs, so Apple's rules still bind.

Where do FCM and APNs settings meet on an iPhone?

For Apple devices FCM relies on APNs underneath. Its HTTP v1 message has an apns block whose headers are Apple's own: apns-expiration, apns-priority and apns-collapse-id. So on iOS the question is rarely which service delivers, but which rule set a field obeys.

The table maps each concern to the Android field and the Apple header. The rest of this page explains where they behave differently.

ConcernFCM on AndroidAPNs header or response
Largest payload4,096 bytes; 1,000 characters from the Firebase console4,096 bytes; 5,120 for VoIP; compressed JSON not allowed
Urgency`priority` normal (default) or high`apns-priority` 10 (default), 5 or 1
Lifetime`ttl` from 0 to 2,419,200 seconds; four weeks if unset`apns-expiration` as a UNIX time; storage of 30 days or less
Replacement`collapse_key`, up to four per device`apns-collapse-id`, at most 64 bytes
Dead token`UNREGISTERED` (404)`410` with reason `Unregistered` or `ExpiredToken`

Checked against: source 1, source 2, source 4, source 6, source 7

What does high priority actually buy?

On Android, normal priority is the default for both message types and may wait until the device leaves Doze. High priority lets FCM wake a sleeping device for brief processing and should lead to something the user sees. Either way onMessageReceived gets only several seconds, a little more for high. Firebase now also points to AndroidConfigV2, where the chosen message type sets urgency instead of a priority field.

APNs has three levels. 10 sends at once, 5 defers to the device's power state, and 1 puts power first and never wakes the device. Apple warns that 5 and 1 may be grouped and arrive in bursts.

The trap sits between them. A silent background push on Apple must use push type background with priority 5, Apple says not to send more than two or three an hour, and the app gets 30 seconds to work. Firebase adds that data messages to Apple devices sent with high priority are rejected with INVALID_ARGUMENT; see the FCM INVALID_ARGUMENT fix.

Checked against: source 3, source 5, source 6, source 8

How long is a message kept for a device that is offline?

FCM stores and retries for the ttl you set, up to 28 days. A ttl of 0 means one attempt and no storage, which gives the best latency and also skips collapsible throttling. On Android, a device silent for more than a month still has messages accepted but at once discarded; if it returns within four weeks of the last data message, the app gets onDeletedMessages().

Android also caps pending non-collapsible messages at 100. Past that, FCM drops all of them and later sends a special message, the cue for a full resync from your server.

APNs keeps one notification per bundle ID, usually the newest, though Apple says that is not guaranteed when several land close together. A nonzero apns-expiration makes it retry until that date; 0 means one attempt without storage. Apple calls the expiry best effort: delivery can still happen after the timestamp. Five alerts sent to a phone in airplane mode can therefore surface as one.

Checked against: source 2, source 6

Collapse key or collapse identifier: what gets replaced?

An FCM collapse_key acts on the queue on Google's side. A new message with the same key and token replaces the one still waiting. FCM stores at most four collapse keys per device and gives no rule for which four survive. Notification messages are always collapsible and ignore collapse_key; payload-free topic messages are collapsible by default; everything else is not.

Apple's apns-collapse-id is about what the person sees: repeat sends with the same value merge into a single notification on the device instead of stacking. The value is capped at 64 bytes.

Collapsing has a throttle on Android. FCM allows a burst of 20 collapsible messages per app per device, refilled at one every 3 minutes, and delays the rest to save battery. For high-rate patterns Firebase suggests non-collapsible messages that carry their content.

Checked against: source 2, source 4, source 9

What do both say about throttling and lost messages?

Neither promises delivery. A message ID from FCM means accepted, not delivered, and FCM does not guarantee order. Apple calls APNs best effort: it may reorder, throttle, store or drop notifications depending on how the person uses the app and the device's power state.

FCM's HTTP v1 API has a default project quota of 600,000 messages a minute, counted in messages, not requests, over minutes not aligned to the clock; excess gets 429 RESOURCE_EXHAUSTED. On Android one device can take 240 messages a minute and 5,000 an hour. For iOS, FCM returns an error once APNs limits are passed.

APNs answers 429 TooManyRequests for too many sends to one token, and TooManyProviderTokenUpdates when the auth token is refreshed more often than every 20 minutes. Apple says 5XX responses can be retried after 15 minutes with backoff.

Checked against: source 2, source 6, source 7, source 9

When should the server delete a device token?

With FCM, delete on UNREGISTERED (404). Treat INVALID_ARGUMENT (400) as a dead token only when the payload is known to be valid. Firebase calls a token stale after a month without connection and expires Android registrations after 270 days idle; iOS tokens follow APNs, which has no such 270-day rule. See the FCM UNREGISTERED fix.

With APNs, a 410 with Unregistered or ExpiredToken means stop, unless the app later hands back the same token; the reply includes a timestamp of when it went invalid. BadDeviceToken (400) can mean the token does not match the environment, sandbox or production. Apple lists these, plus PayloadTooLarge, as not worth retrying. Token setup order on iOS is covered in APNs device token not set before retrieving the FCM token.

Checked against: source 7, source 10

What else do people ask?

Is the payload limit larger if I send to iOS through FCM?

No. FCM's limit is 4,096 bytes for both message types, and Apple's general limit is the same. Only VoIP pushes sent through APNs get 5,120 bytes.

Does an FCM ttl apply to iPhones?

Firebase says to set apns-expiration in the ApnsConfig block for iOS. The ttl field is for Android, and web push takes a TTL header.

Sources

How was this page made?

I drafted this page with AI assistance from the official documents listed under Sources. This page compares Firebase and Apple developer documents fetched on 20 Nov 2026. I did not send pushes through either service for it, so nothing here is a measurement. It does not cover pricing, web push, Live Activities, topic fan-out limits or APNs certificate setup. Found a mistake? Tell me.

Keep reading

Next step

Have a project in mind?

Tell me about it. A discovery call within 48 hours.