RTDN (Real-Time Developer Notifications)
Google's webhook for subscription events. Equivalent of Apple's ASSN.
How it works
- Play sends events to Google Cloud Pub/Sub topic
- Your backend subscribes to topic
- Events delivered as JWT-signed messages
Events you'll get
- SUBSCRIPTION_PURCHASED (initial buy)
- SUBSCRIPTION_RENEWED (auto-renewal)
- SUBSCRIPTION_CANCELED (user-initiated)
- SUBSCRIPTION_EXPIRED (grace period ended)
- SUBSCRIPTION_RECOVERED (came back after hold)
- SUBSCRIPTION_RESTARTED (resubscribed after expiry)
- SUBSCRIPTION_REVOKED (refund)
- SUBSCRIPTION_PAUSE_SCHEDULE_CHANGED
- And ~10 more
Setup
1. Create Pub/Sub topic
Google Cloud Console → Pub/Sub → Topics → Create.
bashgcloud pubsub topics create play-subscriptions
2. Subscribe to topic
Play Console → Monetization setup → Real-time developer notifications:
- Topic name:
projects/your-gcp-project/topics/play-subscriptions - Test connection
- Save
3. Backend subscriber
Option A: Push to your endpoint:
bashgcloud pubsub subscriptions create play-sub \ --topic=play-subscriptions \ --push-endpoint=https://api.yourapp.com/webhooks/play-rtdn
Option B: Pull (poll Pub/Sub from your server):
tsconst subscription = pubsub.subscription('play-sub'); subscription.on('message', (msg) => { const data = JSON.parse(Buffer.from(msg.data, 'base64').toString()); // Process event msg.ack(); });
Verify Play's auth on push
Push endpoint receives JWT. Verify:
tsconst { payload } = await jwtVerify(token, jwks, { issuer: 'accounts.google.com', audience: 'https://api.yourapp.com/webhooks/play-rtdn', });
Use RevenueCat instead (recommended)
RC handles RTDN for you and forwards standardized events.
Pair with
set-up-revenuecat-dashboard-android(alternate, simpler)subscription-server-validation-android


