Mobile Push Payload Builder (APNs and FCM)
Fill in one form and get matching APNs JSON with headers, an FCM v1 message and cURL commands, with size checks and iOS and Android previews.
Körs i din webbläsare. Dina filer lämnar aldrig din enhet. Se hur du kontrollerar det
…
Så gör du
- 1Start from a template
Pick order update, chat, silent sync or marketing.
- 2Write the message
Fill in title, subtitle, body, image, badge and sound.
- 3Set delivery options
Choose priority, interruption level, collapse key, TTL and channel.
- 4Add data fields
Add key and value pairs for your app to read.
- 5Check size and warnings
Watch the byte bars and fix any listed problem.
- 6Copy the output
Switch between APNs, FCM and cURL tabs and copy or download.
Om det här verktyget
Apple Push Notification service and Firebase Cloud Messaging both deliver small JSON messages to phones, but they disagree on almost every field name. APNs wants an aps dictionary with alert, badge, sound and flags such as content-available, plus HTTP/2 headers for push type, priority, topic and collapse ID. FCM HTTP v1 wraps everything in a message object with notification, data, android and apns blocks, and insists that data values are strings. Getting a test notification out often means reading two sets of documentation and hand-editing JSON. This builder takes one set of inputs and produces both payloads side by side, measures them against the 4096-byte limits, checks the common mistakes, and shows a quick preview of how the banner will look on an iPhone lock screen and an Android shade. Templates cover an order update, a chat message, a silent background sync and a marketing push with an image.
Fields and how they map
Title and body become aps.alert on iOS and message.notification on FCM. Subtitle is iOS only. The badge becomes aps.badge and android.notification.notification_count. The thread or tag groups notifications: thread-id on iOS, tag on Android. Category maps to the iOS category for action buttons. Custom data is added as top-level keys in the APNs payload and as string values in FCM data.
Priority, silent pushes and expiry
High priority sends apns-priority 10 and Android HIGH; normal sends 5 and NORMAL. A silent push sets content-available to 1, drops the alert, and must use apns-push-type background with priority 5. Time to live becomes the apns-expiration header and the FCM android.ttl in seconds. A collapse key replaces an older undelivered notification with the newest one.
Checks
The builder warns when either payload exceeds 4096 bytes, when a collapse ID is longer than 64 bytes, when a data key uses a name FCM reserves, when an image URL is not https, when a TTL exceeds FCM's 28-day maximum, and when you pick the critical interruption level, which needs an Apple entitlement.
Output
Copy or download the APNs JSON and headers, the full FCM v1 request body, or ready cURL commands for the APNs sandbox or production gateway and the FCM endpoint. Previews are approximations: real devices truncate text by font size and screen width.
Limits
The page does not send notifications and never asks for keys. You run the cURL commands with your own JWT or OAuth access token. It does not cover web push, Huawei or VoIP pushes, and Live Activity payloads are not included.
Lösta exempel
An order service needs a shipping notice. The template fills title Your order has shipped, subtitle Order #4821, a body of 54 characters, badge 1, thread orders, collapse key order-4821, TTL 86400 seconds and two data fields. The APNs payload is 295 bytes and the FCM message 733 bytes, both far below 4096. Adding a 4,500-character body raises an error on both platforms. Switching to the silent sync template removes the alert, sets content-available to 1 and changes the push type header to background with priority 5.
I korthet
- Kategori: Utvecklare & data
- Körs i webbläsaren, ingen registrering, ingen uppladdning.
- Uppgifterna du anger stannar på din enhet.
- Finns på engelska.
- Innehållet granskades senast:
- Officiell källa: Apple, Generating a remote notification; Firebase, Cloud Messaging HTTP v1 reference
Vanliga frågor
What is the maximum push payload size?
4096 bytes for a regular APNs notification and for an FCM message. VoIP pushes allow 5120 bytes on APNs. The builder counts UTF-8 bytes, so emoji and accented letters count more than one.
Why must FCM data values be strings?
The HTTP v1 API defines data as a map of string to string. Numbers and booleans must be sent as text and converted in the app.
What does mutable-content do?
It lets a Notification Service Extension change the notification before it is shown, for example to download an image or decrypt the text. It is set automatically when you add an image.
Why is my silent push not delivered?
Background pushes must use priority 5 and push type background, and iOS throttles them heavily. Low Power Mode and force-quitting the app also stop delivery.
What is the difference between notification and data messages on Android?
A notification message is shown by the system when the app is in the background. A data-only message is always passed to your app's messaging service, which decides what to show.
Do you store my device token?
Only in this browser's local draft if you type one. Nothing is sent from the page.
