Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4791 pages

APIs and integrations

App Store Server Notifications vs Google Play RTDN: What the Back End Receives

In short

Apple posts a JWS-signed payload straight to your HTTPS URL, with the transaction and renewal data inside, and retries five times in production only. Google Play publishes a small base64 message to a Cloud Pub/Sub topic you own. For subscriptions it carries a type number and a purchase token, so your back end calls the Play Developer API for the state, and Pub/Sub settings decide redelivery.

How does each notification arrive, and how is it verified?

Apple sends an HTTP POST to the production URL, and optionally a sandbox URL, set in App Store Connect. The server needs TLS 1.2 or later, a named port must be 443 or at least 1024, and Apple gives 17.0.0.0/8 as the subnet to allow. The body carries signedPayload, a JWS signed by the App Store.

The proof travels inside the message. Its JWS header carries an x5c chain: the signing certificate, an Apple intermediate, then an Apple root from Apple PKI. The transaction and renewal objects inside are separately signed JWS strings, the same format the App Store Server API returns.

Google Play publishes to a Cloud Pub/Sub topic in your own Google Cloud project, once you grant google-play-developer-notifications@system.gserviceaccount.com the Pub/Sub Publisher role and enter the topic in Play Console for each app. A push subscription sends HTTPS requests to your endpoint; pull has your server fetch. Google suggests push when unsure.

The RTDN pages I read describe no signature on the notification data. Trust comes from Pub/Sub: an authenticated push subscription adds a Google-signed OpenID Connect JWT in the Authorization header, whose signature, email and audience claims the endpoint should check. I would still treat the follow-up API call as the real check.

ConcernApp Store Server Notifications V2Google Play RTDN
TransportHTTPS POST from Apple to your URLPub/Sub topic in your project, push or pull
AuthenticityJWS with an x5c chain to an Apple rootPub/Sub push JWT, if authentication is set
Duplicate key`notificationUUID``messageId`
Success replyHTTP 200 to 206Push: 102, 200, 201, 202 or 204

Checked against: source 2, source 3, source 4, source 5, source 7, source 13, source 14, source 19, source 20

What does the message say, and what must the back end still fetch?

Apple's decoded payload names the event in notificationType and an optional subtype, with notificationUUID, signedDate and version 2.0. For purchase events a data object adds the bundle ID, the environment, the subscription status as of signing, and the signed transaction plus, for auto-renewable subscriptions, signed renewal info. Apple's guidance is to update the customer's service from that type and signed data; the deprecated receipt route has its own verifyReceipt fix.

A decoded RTDN holds version, packageName, eventTimeMillis and one of five mutually exclusive objects: subscription, one-time product, voided purchase, pending refund review or test. A SubscriptionNotification carries a version, an integer notificationType and the purchaseToken. Google says you must then call the Play Developer API, because the message only says the state changed.

For subscriptions that call is purchases.subscriptionsv2.get. It returns subscriptionState, line items with expiryTime, linkedPurchaseToken after upgrades or resubscribes, and acknowledgementState; a new subscription left unacknowledged for three days is refunded and revoked. A VoidedPurchaseNotification is the exception: Google says its fields, order ID and refund type among them, are enough to locate the purchase and order for an entitlement adjustment.

Checked against: source 3, source 5, source 6, source 13, source 15, source 16

Which notification types correspond?

The pages I read publish no cross-store mapping, so the pairs below are my reading of events both lifecycle pages describe, and the lost-access and refund rows are the loosest fits. Apple puts the reason in a subtype; Google sends a number and leaves the detail to the subscription resource.

Billing failures line up most closely. Apple keeps retrying billing for 60 days, and Google's account hold defaults to 60 days minus any grace period. The endings differ: Apple sends EXPIRED with subtype BILLING_RETRY, while Google sends SUBSCRIPTION_CANCELED and straight after it SUBSCRIPTION_EXPIRED. Even with a zero-day grace period, Play waits at least a day, the subscription still active, before notifying.

Refund disputes do not pair. Apple's CONSUMPTION_REQUEST asks for consumption data, if the customer consented, within 12 hours of the notification. Google's PendingRefundReviewNotification covers chargebacks only and wants a refund suggestion with usage evidence through the ReviewRefund API within 24 hours. Apple's REFUND_REVERSED has no counterpart on the Google pages I read.

EventApple notificationType (subtype)Google SubscriptionNotification type
First purchase`SUBSCRIBED` (`INITIAL_BUY`)`SUBSCRIPTION_PURCHASED` (4)
Successful renewal`DID_RENEW``SUBSCRIPTION_RENEWED` (2)
Auto-renew turned off, access runs to period end`DID_CHANGE_RENEWAL_STATUS` (`AUTO_RENEW_DISABLED`)`SUBSCRIPTION_CANCELED` (3)
Turned back on before expiry`DID_CHANGE_RENEWAL_STATUS` (`AUTO_RENEW_ENABLED`)`SUBSCRIPTION_RESTARTED` (7)
Payment failed, keep access`DID_FAIL_TO_RENEW` (`GRACE_PERIOD`)`SUBSCRIPTION_IN_GRACE_PERIOD` (6)
Payment failed, access stops while the store retries`DID_FAIL_TO_RENEW` (no subtype) or `GRACE_PERIOD_EXPIRED``SUBSCRIPTION_ON_HOLD` (5)
Payment recovered`DID_RENEW` (`BILLING_RECOVERY`)`SUBSCRIPTION_RECOVERED` (1)
Subscription ended`EXPIRED` (subtype gives the reason)`SUBSCRIPTION_EXPIRED` (13)
Refund removes access`REFUND``SUBSCRIPTION_REVOKED` (12), documented for revokes and chargebacks; a refund that voids the purchase comes as a `VoidedPurchaseNotification`

Checked against: source 8, source 12, source 13, source 15, source 17

What happens when the endpoint fails?

Apple counts 200 to 206 as success, asks for a 40x or 50x when you want a retry, and treats every other code as unsuccessful. Version 2 notifications are retried five times, at 1, 12, 24, 48 and 72 hours after the previous attempt. By my arithmetic that makes six attempts, the last about 157 hours, or six and a half days, after the first. Only production retries; the sandbox sends once.

After that, Get Notification History returns what Apple tried to send: 180 days back in production, 30 in sandbox, 20 records per call. Records show the purchase as it was when sent; current subscription state comes from Get All Subscription Statuses.

On Google the retry belongs to Pub/Sub, not Play. Any push reply other than 102, 200, 201, 202 or 204, or a missed acknowledgment deadline, gets the message resent. The default policy resends immediately; an optional exponential backoff has a 600-second ceiling and a 10-second default minimum, and many failures can add a push backoff of up to 60 seconds.

Retention sets the outage budget. Unacknowledged messages are kept 7 days by default and 31 at most, then may be discarded, and keeping them past 24 hours adds charges. Without subscriber activity such as successful pushes, the subscription itself expires after 31 days by default. The Voided Purchases API reaches back only 30 days. Ack deadlines are compared in the queue delivery post.

Payment and repo platforms such as Stripe and GitHub run their own webhook retry rules, compared in webhook retry policies for Stripe, GitHub, Shopify and Slack.

Checked against: source 4, source 9, source 13, source 17, source 19, source 21

How do test notifications and the sandbox compare?

Apple runs two environments. Request a Test Notification has a production and a sandbox URL, each sending a TEST notification to the matching configured URL, and its testNotificationToken lets Get Test Notification Status show what your server answered. TEST comes in version 2 format even when the URL is set for version 1, which Apple has deprecated. Sandbox and TestFlight events carry a sandbox environment value. Tester sign-in trouble is covered in the sandbox account fix.

Each Play app has one RTDN topic setting, and the pages I read describe no separate sandbox channel. Play Console's Send Test Message, the only source of test publishes, sends a testNotification holding just a version, so a handler should branch on it before looking for a token. The test page names one RTDN that a license-tester purchase triggers, below, and the subscription resource marks test purchases with a testPurchase field.

Timing differs in testing too. Play test subscriptions renew faster and at most six times, an unacknowledged license-tester purchase is refunded after 3 minutes, and a chargeback test card should bring a PendingRefundReviewNotification moments later. Setup trouble is covered in the Play purchase testing fix. As Apple's sandbox never retries, I would test recovery code against Get Notification History.

Checked against: source 1, source 2, source 4, source 10, source 11, source 13, source 14, source 16, source 18

What else do people ask?

Why can one Apple event arrive up to six times?

In production a failing endpoint gets the first attempt plus five retries. Return 200 once the event is stored, and drop repeats by notificationUUID.

Sources

How was this page made?

I drafted this page with AI assistance from the official documents listed under Sources. This page compares Apple, Google Play and Google Cloud documents fetched on 21 Nov 2026. I did not run a subscription back end against either store for it, so nothing here is a measurement. It leaves out one-time products in depth, Apple's Advanced Commerce API and external purchase tokens, Play installment plans, prices and store commission. Found a mistake? Tell me.

Keep reading

Next step

Have a project in mind?

Tell me about it. A discovery call within 48 hours.