https://openrevive.org/push-protocol.html
Push protocol and API
Push overview and evidence · Operations and trust
This describes the implemented iOS 6.1.3 path, not a complete specification of APNs. The native token, subscription, delivery and ACK chain was physically verified on 16 October 2026.
Discovery and courier
The observed production client requests http://init-p01st.push.apple.com/bag. The sandbox discovery name is init-s01st.push.apple.com. A plist envelope carries raw bag bytes, a certificate chain in certs and an RSA/SHA1 signature over the bag. The inner plist sets APNSCourierHostname, APNSCourierHostcount and APNSCourierStatus.
The lab supplies its own signed bag and courier host, using a dedicated Push Lab CA and explicit controlled routing. SHA1 is retained only where this legacy format requires it. Provider HTTPS has a separate modern TLS policy. The courier listens on TCP 5223.
Frames and fields
command: u8 | body_length: u32 big-endian | body
body = repeated(field_id: u8 | length: u16 big-endian | value)
The parser supports fragmented streams, repeated field IDs and bounded lengths; malformed frames are rejected. A topic is the SHA1 hash of the UTF-8 application topic string.
| Command | Behavior
| 0x07 Connect | Phone to server. Optional token field 1, state 2, flags 5. The authenticated certificate selects the device.
| 0x08 ConnectResponse | Server to phone. Status 0 in field 1, 32-byte token in field 3, maximum message size in field 4.
| 0x09 Filter | Enabled topic hashes in field 2; ignored topic hashes in field 3. Only subscribed topics are dispatched.
| 0x0A Notification | Token 1, topic hash 2, UTF-8 JSON 3, four-byte message ID 4, expiry 5, storage flags 9.
| 0x0B ACK | Message ID field 4, result field 8. Correlated only within the authenticated target device.
| 0x0C / 0x0D | Keepalive request/response.
| 0x0F / 0x10 | Bounded flush/padding response.
The iOS 6 evidence requires notification flags in field 9, rather than field 7 in the older pushproxy notes. ConnectResponse status 2 deletes the native identity and is never emitted. Newer 0x11/0x12 token commands are outside this adapter.
Provider API
JSON over HTTPS. Admin and provider bearer credentials are separate. A registration ticket binds the provider, user, topic and environment. The app receives only the scoped ticket, never a provider or admin key. Paths below document the lab API; no public enrollment service is offered.
| Operation | Authorization and result
| POST /v1/devices/enroll | Admin. Enroll a certificate SHA-256, label and environment; returns a device ID.
| POST /v1/tickets | Provider. Select topic, environment and authenticated user ID; returns a short-lived ticket.
| POST /v1/registrations | Ticket. Bind native token, topic, environment and installation ID. Returns registration/device IDs and token hash.
| POST /v1/push | Provider. Send token, topic, payload, TTL and idempotency key; HTTP 202 returns a queued message ID.
| GET /v1/messages/ | Owning provider. Read status, payload hash, timestamps, attempt count and ACK result.
A provider owns an explicit topic/environment pair. Cross-provider access, unknown tokens, mismatched identities and changed ticket replays are rejected. An identical successful registration replay is idempotent. An installation cannot silently change device identity. The app backend owns user authentication and its user-to-token relationship; there is no registration-list or user lookup endpoint yet.
Queue semantics
Tokens are stable per enrolled identity/environment. The queue persists offline messages and survives process termination. Stage 1 limits a serialized payload to 256 UTF-8 bytes, TTL to 1–86400 seconds, pending messages to 1000 per device and inflight messages to 16. An unacknowledged send retries after 30 seconds. A lost ACK can cause duplicates; expired messages are suppressed.
States are queued, sent, courier_acked, courier_rejected and expired. Native ACK status 0 means courier acceptance, not that the user read the notification. The current deployment is production-only. Sandbox needs a separately environment-bound courier and matching discovery route.