Push Notification Payload Builder
Build push notification JSON payloads for FCM (Firebase Cloud Messaging) v1 API, FCM Legacy API, and APNs (Apple Push Notification Service). Generate ready-to-use JSON with custom data, priority settings, and platform-specific fields.
How Does the Push Notification Payload Builder Work?
The Push Notification Payload Builder is a free browser-based tool that generates valid JSON payloads for sending push notifications via Firebase Cloud Messaging (FCM) or Apple Push Notification Service (APNs). Select your target platform, fill in your notification details, and instantly get a properly structured JSON payload ready to use in your API calls or testing tools.
Push notifications are a critical engagement channel for mobile apps, but crafting the correct JSON payload format can be tricky. Each platform has its own structure, required fields, and naming conventions. FCM v1 API uses a nested message object with platform-specific overrides for Android and iOS. The legacy FCM API uses a flatter structure with a "to" field for targeting. APNs requires a specific "aps" dictionary with alert, sound, and badge fields. Getting any of these wrong means your notifications silently fail with no feedback to the user.
Supported Platforms
FCM v1 API is Google's current recommended API for Firebase Cloud Messaging. It uses OAuth 2.0 authentication and supports platform-specific notification customization. The generated payload includes both Android-specific fields (like channel_id and priority) and APNs-specific fields (like sound and badge) in a single request, letting FCM handle delivery to both platforms.
FCM Legacy API is the older HTTP API that uses a server key for authentication. While Google recommends migrating to v1, many existing projects still use this format. The legacy payload is simpler and flatter, using a "to" field for topic targeting and a top-level "priority" field.
APNs (Apple) generates the JSON payload format required by Apple's Push Notification Service. This includes the required "aps" dictionary with alert title and body, sound configuration, badge count, and the mutable-content flag for notification service extensions. Custom data keys are placed at the top level alongside the "aps" dictionary.
Custom Data and Priority
All three platforms support custom key-value data that your app can read when the notification is received. Enter pairs in the format "key1=value1, key2=value2" and the builder will place them in the correct location for each platform. The priority setting controls whether the notification is delivered immediately (high) or batched for battery optimization (normal). High priority should be used for time-sensitive notifications like messages or alerts, while normal priority is appropriate for content updates and non-urgent information.
All processing happens entirely in your browser. Your notification content, server keys, and custom data never leave your device, making this tool safe to use with production payloads and sensitive data fields.
Frequently Asked Questions
What is the difference between FCM v1 API and FCM Legacy API?
FCM v1 API is Google's current recommended API that uses OAuth 2.0 for authentication and supports platform-specific notification customization in a single request. The Legacy API uses a simpler server key authentication and a flatter JSON structure. Google recommends migrating to v1, but many existing projects still use the legacy format. The v1 API provides better targeting, analytics, and cross-platform payload control.
When should I use high priority vs normal priority?
Use high priority for time-sensitive notifications like instant messages, incoming calls, or urgent alerts that the user needs to see immediately. Use normal priority for content updates, promotional messages, and non-urgent information. High priority notifications wake the device from doze mode on Android and are delivered immediately, while normal priority notifications may be batched to conserve battery.
How do I add custom data to my push notification?
Enter key-value pairs in the custom data field using the format "key1=value1, key2=value2". The builder will parse these and place them in the correct location for your selected platform. In FCM, custom data goes in the "data" object. In APNs, custom keys are placed at the top level of the payload alongside the "aps" dictionary. Your app can read these values when handling the notification.
What headers do I need to send with these payloads?
For FCM v1 API, you need "Authorization: Bearer <OAuth2-token>" and "Content-Type: application/json". For FCM Legacy API, use "Authorization: key=<server-key>" and "Content-Type: application/json". For APNs, you need "authorization: bearer <provider-token>", "apns-topic: <bundle-id>", and "apns-push-type: alert". The exact authentication method depends on your project configuration.
Is my notification data sent to any server?
No. This tool runs entirely in your browser using JavaScript. Your notification titles, body text, image URLs, custom data, and all other inputs stay on your device and are never transmitted to any server. This makes it safe to use with production content, test tokens, and sensitive data fields.