Google Play in-app purchase notifications on your phone.
Get a push notification when someone buys a one-time product (an in-app purchase) in your Google Play app.
Three steps to your first push
Install the recipe
One click in Studio gives you a personal webhook URL.
Paste your URL into Google Play
Add it as a webhook for Get all notifications for subscriptions and one-time products.
Get a push on your phone
With the text, sound and buttons from the recipe.
How to set up the Google Play get all notifications for subscriptions and one-time products webhook
- Click Install in Studio and sign in. The recipe is added to your account and you get a personal webhook URL.
- In Google Cloud, create a Pub/Sub topic and give [email protected] the Pub/Sub Publisher role on it.
- Add a push subscription to that topic with your webhook URL as the endpoint URL.https://••••••••/•••••••• your personal URL, shown after install
- In Play Console, open your app's Monetize > Monetization setup, enable real-time notifications, enter the full topic name and choose Get all notifications for subscriptions and one-time products.
- Click Send test message; you should get a quiet Google Play connected push.
- Google Play doesn't call webhooks directly. It publishes **real-time developer notifications** (RTDN) to a Google Cloud Pub/Sub topic, and a Pub/Sub **push subscription** forwards each one to JustPush.
- **1. Create the topic and let Google Play publish to it.** In the [Google Cloud console](https://console.cloud.google.com/cloudpubsub/topic/list), open **Pub/Sub → Topics → Create topic**. Open the topic's **Permissions**, click **Add principal**, enter `[email protected]` and give it the **Pub/Sub Publisher** role. (If your organization restricts sharing by domain, it needs an exception for that account.)
- **2. Push it to JustPush.** On the topic, click **Create subscription**, set **Delivery type** to **Push** and paste this as the **Endpoint URL**:
- ```
- your webhook URL
- ```
- Leave **payload unwrapping** and authentication off. Or do steps 1 and 2 with `gcloud`:
- ```
- gcloud pubsub topics create play-rtdn
- gcloud pubsub topics add-iam-policy-binding play-rtdn \
- --member=serviceAccount:[email protected] \
- --role=roles/pubsub.publisher
- gcloud pubsub subscriptions create play-rtdn-justpush \
- --topic=play-rtdn --push-endpoint="your webhook URL"
- ```
- **3. Point Play Console at the topic.** In [Play Console](https://play.google.com/console), select your app and open **Monetize → Monetization setup**. Under **Real-time developer notifications**, tick **Enable real-time notifications**, enter the full topic name (`projects/<project-id>/topics/play-rtdn`), choose **Get all notifications for subscriptions and one-time products** (the other option leaves out one-time purchases) and click **Save changes**. Then click **Send test message**: you'll get a quiet **🔔 Google Play connected** push.
- Each app is set up separately, but several apps can share one topic. Each Google Play recipe is its own integration with its own push subscription on the same topic.
- **The pushes are thin, on purpose.** RTDNs only say *that* something changed: the app's package name, the notification type and a purchase token. There's no price, no customer and no country; getting those means calling the Play Developer API, which a recipe can't do.
- Pub/Sub retries a push until JustPush accepts it. Its push requests can carry a signed Google token, but JustPush doesn't check it (`verify: none`), so keep your endpoint URL private.
- To skip canceled pending purchases (such as a cash payment that was never completed), add `?pending=0` to the push endpoint URL: `your webhook URL?pending=0`
What runs when the webhook arrives
Studio calls handleRequest(request) with the incoming webhook and sends the message it returns. It's yours after install; change anything.
The Google Play oneTimeProductNotification webhook
This is what Google Play sends to your URL for get all notifications for subscriptions and one-time products. It is a sample, trimmed to the fields recipes use.
Google Play in-app purchase notifications: questions
Does this work on iPhone and Android?
Yes. Install the JustPush app from the App Store or Google Play and sign in. Every phone signed in to your account gets the notification.
Do I need to write code?
No. Install the recipe in Studio, paste your webhook URL into Google Play and you are done. The code is there if you want to change the text, the sound or the buttons.
Can I change what the notification says?
Yes. After install the recipe's code is yours. Edit it in Studio and test it against the sample payload before you save.
What does it cost?
JustPush is free for 30 days. After that it's $19.99 a year, or $39.99 once. There is no extra charge for recipes.
Google Play on your phone in two minutes.
Install the recipe, paste one URL, done. Free for 30 days, no credit card required.