Real-Time Developer Notifications — decode and inspect Pub/Sub messages from Google Play.
gpc rtdn <subcommand> [options]Commands
| Command | Description |
|---|---|
rtdn status | Check RTDN notification topic configuration |
rtdn decode | Decode a base64-encoded Pub/Sub notification payload |
rtdn test | Guidance for testing RTDN setup |
Overview
Google Play sends Real-Time Developer Notifications (RTDN) via Cloud Pub/Sub when subscription and purchase events occur. GPC provides tools to inspect your RTDN configuration and decode notification payloads.
How RTDN Works
- You create a Pub/Sub topic in your GCP project
- You configure the topic in Play Console (Monetization setup)
- Google Play publishes base64-encoded JSON messages to your topic
- Your backend subscribes to the topic and processes events
GPC helps with steps 1-2 (checking configuration) and decoding messages for debugging.
rtdn status
Check whether RTDN is configured for your app.
Synopsis
gpc rtdn status [options]Example
gpc rtdn status --app com.example.myappRTDN Status — com.example.myapp
──────────────────────────────────────────────────
Topic: projects/my-project/topics/play-notifications
Enabled: yes2
3
4
If no topic is configured, GPC shows setup instructions.
rtdn decode
Decode a base64-encoded Pub/Sub notification payload into a readable format.
Synopsis
gpc rtdn decode <base64-payload>Example
gpc rtdn decode "eyJ2ZXJzaW9uIjoiMS4wIiwicGFja2FnZU5hbWUiOiJjb20uZXhhbXBsZSIs..."packageName com.example.myapp
eventTime 2026-03-28T10:00:00.000Z
version 1.0
type subscription
event SUBSCRIPTION_PURCHASED
subscriptionId premium_monthly
purchaseToken abc123def456...2
3
4
5
6
7
JSON Output
gpc rtdn decode <payload> --output jsonReturns the full decoded notification object including all fields.
Notification Types
Subscription events:
| Code | Event |
|---|---|
| 1 | SUBSCRIPTION_RECOVERED |
| 2 | SUBSCRIPTION_RENEWED |
| 3 | SUBSCRIPTION_CANCELED |
| 4 | SUBSCRIPTION_PURCHASED |
| 5 | SUBSCRIPTION_ON_HOLD |
| 6 | SUBSCRIPTION_IN_GRACE_PERIOD |
| 7 | SUBSCRIPTION_RESTARTED |
| 8 | SUBSCRIPTION_PRICE_CHANGE_CONFIRMED |
| 9 | SUBSCRIPTION_DEFERRED |
| 12 | SUBSCRIPTION_REVOKED |
| 13 | SUBSCRIPTION_EXPIRED |
One-time product events:
| Code | Event |
|---|---|
| 1 | ONE_TIME_PRODUCT_PURCHASED |
| 2 | ONE_TIME_PRODUCT_CANCELED |
Other events: VOIDED_PURCHASE, TEST_NOTIFICATION
rtdn test
Shows instructions for sending a test notification from the Play Console.
gpc rtdn testSetup Guide
Create a Pub/Sub topic in your GCP project:
gcloud pubsub topics create play-notifications1Grant publish access to Google Play:
gcloud pubsub topics add-iam-policy-binding play-notifications \ --member="serviceAccount:google-play-developer-notifications@system.gserviceaccount.com" \ --role="roles/pubsub.publisher"1
2
3Configure in Play Console: Go to Monetization setup > Real-time developer notifications > Set your topic name
Send a test notification from the Play Console to verify the setup
Decode the test message:
bashgpc rtdn decode <base64-payload-from-pubsub>1
Notes
- RTDN requires a GCP project with Pub/Sub enabled
- The service account used by GPC does not need Pub/Sub permissions — RTDN uses a separate Google-managed service account for publishing
- Test notifications can only be triggered from the Play Console UI
- RTDN is essential for subscription-based apps to track lifecycle events in real time
