Mobile, Cloud & DevOps Tools

Mobile Push Payload Builder

Build and validate native push payloads for APNs and FCM HTTP v1: required keys, the 4 KB size limit, priority, collapse and expiry fields, sound, badge and data - with curl request templates and no credentials.

  • APNs and FCM JSON
  • Validation findings and size
  • curl templates
Runs in your browser

Everything you paste, type or drop is processed in this browser tab. It is not uploaded, logged, stored or sent to analytics.

Push payloads workspace

1 The notification

Examples:

Values are sent as strings for FCM, as HTTP v1 requires.

A newer notification with the same ID replaces the older one.

0 means deliver now or drop. Blank uses each service's default.

Apple (APNs) options
Firebase (FCM HTTP v1) options

For a device token the builder uses a placeholder - never paste a real token into a web page you do not control.

Validate a payload you already have

Detected automatically. For APNs headers, the options above are used.

2 Payloads and checks

Enter a title or body, or load an example.

How this differs from Push Notification Tester

The Push Notification Tester sends test web push notifications to a browser. This builder is for native mobile push: it composes and validates the JSON payloads that Apple Push Notification service and Firebase Cloud Messaging expect - required keys, the size limit, priority, collapse and expiry fields - and never sends anything or asks for credentials.

What the Mobile Push Payload Builder does

This builder writes and checks the JSON that native mobile push services expect: the payload and headers for Apple Push Notification service (APNs) and the request body for Firebase Cloud Messaging's HTTP v1 API. It checks required keys, the 4 KB size limits, priority, collapse and expiry fields, and the mistakes that make a push fail silently - and it never sends anything or asks for a key or token.

It is not a web push tester. The site's Push Notification Tester sends test notifications to a browser through the Web Push protocol; this page is for iOS and Android apps, where the payload goes to Apple or Google from your own server.

How to use it

  1. Write the title and body, and any custom data as key=value lines - an order ID or a deep link, for instance.
  2. Choose a visible alert or a silent background update. Background pushes carry no title or sound, use apns-priority 5, and wake the app to fetch new data.
  3. Set a collapse ID if a newer notification should replace an older one, such as a live score, and how long the services should keep it for an offline device.
  4. Adjust the Apple and Firebase options, then read the checks under each payload. Fix anything marked as a problem.
  5. Copy the JSON, download both payloads, or copy the curl templates. They use shell variables such as $APNS_JWT and $ACCESS_TOKEN that you set on your own machine.

Reading the results

Sizes are measured as compact UTF-8 JSON, which is how APNs counts its 4,096-byte limit (5,120 for VoIP). For FCM the figure is an estimate of the notification and data parts; Google measures the stored payload, which is close but not identical.

Problems are rule breaks that make APNs or FCM reject the request or drop the notification: a missing aps dictionary, a non-string FCM data value, a background push at priority 10, a TTL over 28 days. Warnings are likely mistakes; notes explain what a field will do.

With the apns block included, iOS devices reached through FCM get the same priority, collapse ID and alert as a direct APNs push, instead of FCM's defaults.

Worked example: an order-shipped notification

The order example has the title "Your order has shipped", a one-sentence body, an order ID and a deep link, a badge of 1 and the collapse ID order-1042.

The APNs payload is 208 bytes of the 4,096 allowed, with the order ID and deep link beside the aps dictionary where Apple expects custom keys. The headers set apns-push-type alert, priority 10, the collapse ID, and an expiration 24 hours from now, because the offline time was set to 86,400 seconds.

The FCM body targets a device-token placeholder, sends the data values as strings, sets android.priority HIGH, a TTL of "86400s" and collapse_key order-1042. Its notification and data parts come to about 167 bytes.

Collapse, priority and expiry in one place

The three fields that decide what happens to a notification in transit have different names on each service. Apple uses the apns-collapse-id, apns-priority and apns-expiration headers; FCM uses android.collapse_key, android.priority and android.ttl, and passes Apple's headers through in the apns block. The builder fills all of them from one set of inputs, so an update that should replace the previous one does so on both platforms.

Expiry is easy to get backwards. APNs wants an absolute UNIX time; FCM wants a relative duration such as "3600s". Zero means the same on both: try once, then discard.

Limitations: what the result does not prove

  • It validates structure and documented rules. It cannot tell whether a device token, bundle ID, topic subscription or Firebase project is real - only a send from your server can.
  • Delivery is never guaranteed. Apple and Google throttle background and low-priority pushes, and devices in low-power modes may defer them however the payload is written.
  • Rich content such as images needs app-side code (a notification service extension on iOS, a channel and handler on Android); the payload only carries the pointer.

Privacy: where your data goes

Everything you paste, type or drop is processed in this browser tab. It is not uploaded, logged, stored or sent to analytics. Session recording and tag-manager scripts are switched off on this page.

Standards and sources

Frequently asked questions

What is the maximum APNs payload size?

4 KB (4,096 bytes) for regular remote notifications and 5 KB (5,120 bytes) for VoIP notifications, measured on the JSON payload. APNs rejects anything larger with PayloadTooLarge, so keep bulky data on your server and send an ID.

Why must FCM data values be strings?

The HTTP v1 API defines data as a map of string to string. Numbers, booleans and nested objects are rejected with INVALID_ARGUMENT. Send 42 as "42", and send structured data as a JSON string your app parses.

What priority should a silent push use?

Apple requires apns-priority 5 for background notifications with content-available set to 1 and no alert, sound or badge. Priority 10 is for alerts shown immediately. On Android, a data-only message can be NORMAL unless it must wake the device at once.

How does a collapse ID work?

When several notifications share a collapse ID, the newest replaces the earlier ones, both on the device and in the service's queue for an offline device. It suits things like a live score or an order status. Apple limits the ID to 64 bytes; FCM stores at most four different collapse keys per device at once.

Is my payload in the legacy FCM format?

If it uses to, registration_ids, time_to_live or a top-level priority, yes. Google shut down the legacy HTTP API in 2024; HTTP v1 wraps the message in a message object with token, topic or condition, and per-platform android and apns blocks. The checker flags legacy fields.

How is this different from the Push Notification Tester?

The Push Notification Tester sends test web push notifications to a browser using the Web Push protocol. This builder is for native iOS and Android apps: it composes and validates APNs and FCM payloads, sizes and delivery options, and it sends nothing.

Can I send a test notification from this page?

No, deliberately. Sending needs your Apple signing key or a Google service-account credential, which should never be pasted into a web page. Use the curl templates on your own machine with the credentials in environment variables.

Last reviewed by the A2Z.Tools team against the sources listed above.

Rate this tool

Was this tool useful? Your feedback helps us improve it.

No ratings yet — be the first to rate this tool.
Your rating (required)
0 / 2000

Please do not include passwords, payment details or other sensitive information.

Your feedback is sent privately to the A2Z.Tools team and will not be posted publicly.