APNs payload validator

Push notification tester

Build an Apple push notification payload, check it against the APNs rules and size limit, and copy a ready curl, FCM or Simulator command.

No key, certificate or device token is needed or sent. The page only builds and checks JSON. Commands use shell variables you fill in on your own machine.

Notification
Request headers

APNs request (HTTP/2, token auth)

FCM HTTP v1 equivalent

iOS Simulator

xcrun simctl push booted com.example.app payload.json

Save the payload as payload.json and use your bundle ID. The Simulator needs no device token or key.

What the validator checks

Sending the request

Token-based requests need a JSON Web Token signed with your .p8 key (ES256, with your Key ID and Team ID). Generate it on your own machine or server and keep the key private; a token is valid for up to an hour. Certificate-based requests use your push certificate with curl --cert instead of the authorization header.

Use the sandbox host for apps installed from Xcode and the production host for TestFlight and App Store builds. A BadDeviceToken error usually means the token and the environment do not match; DeviceTokenNotForTopic means apns-topic is not the app's bundle ID.

More detail: test push notifications without a server and the sending side of APNs.

Privacy

Everything on this page runs in your browser. It never asks for a .p8 key, certificate, JWT or device token, and nothing you type is sent anywhere.

Questions

What is the maximum APNs payload size?

4,096 bytes for regular notifications and 5,120 bytes for VoIP notifications, counted as UTF-8 JSON. Larger payloads are rejected with PayloadTooLarge.

Do I need to enter my .p8 key or device token?

No. This page only builds and checks the payload and prints commands with placeholders. You add the token and key on your own machine.

Why does my silent push not arrive?

A background push needs content-available set to 1, apns-push-type background, priority 5 and no alert, sound or badge. iOS also throttles background pushes, so some are delayed or dropped.

Should content-available be true or 1?

Use the number 1. Apple documents the value as 1, and a boolean may be ignored.

How do I test push notifications on the iOS Simulator?

Save the payload to a file and run xcrun simctl push booted followed by your bundle ID and the file name, or drag an .apns file onto the Simulator.

From the same developer