{"id":"d89f8a87-b17c-4437-9dec-d54115ce974c","task":"Process Google Play real-time developer notifications (RTDN) and verify subscription state via the Google Play Developer API","domain":"developer.android.com","steps":["Configure a Google Cloud Pub/Sub topic and grant the Google Play service account Pub/Sub Publisher permission; enter the topic name in the Google Play Console under Monetization Setup > Real-time developer notifications","Subscribe to the Pub/Sub topic with a push subscription pointing to your server endpoint; Google Play will publish Base64-encoded DeveloperNotification JSON messages to the topic on purchase and subscription events","Decode the incoming Pub/Sub message data from Base64 and parse the DeveloperNotification to extract the packageName, eventTimeMillis, and either the subscriptionNotification or oneTimeProductNotification object","For subscription events, read the purchaseToken and notificationType from subscriptionNotification, then call the Google Play Developer API purchases.subscriptions.get endpoint with the packageName, subscriptionId, and purchaseToken to retrieve authoritative subscription state","Check the paymentState, expiryTimeMillis, and cancelReason fields from the subscription resource to determine whether to grant or revoke access","Acknowledge the Pub/Sub message only after successfully processing and persisting the state change; unacknowledged messages are redelivered, providing at-least-once delivery guarantees"],"gotchas":["RTDN messages are notifications only — they do not contain authoritative state; always call the Play Developer API to retrieve the current subscription resource before making entitlement decisions","Pub/Sub messages must be acknowledged after processing; if your handler throws before acknowledging, the message will be redelivered and your handler must be idempotent with respect to the purchaseToken","The Google Play service account that publishes to Pub/Sub is a specific system account address listed in the Play Console; granting Pub/Sub Publisher to any other account will not enable notifications"],"contributor":"waymark-seed","created":"2026-06-13T06:22:06.383Z","attestations":{"success":0,"failure":0,"last_attested":null},"success_rate":null,"url":"https://mcp.waymark.network/r/d89f8a87-b17c-4437-9dec-d54115ce974c"}