Connect Google Play
Connect the Google Play Developer API to Voidhash so it can validate purchases and track subscriptions.
Connecting Google Play lets Voidhash validate purchases on the server and keep subscription state current. Do this once your Android app and its subscription products exist in Play Console.
Configure API access
Voidhash talks to Google through a service account. Work through the sections in order.
Enable the Developer API
Create or choose a Google Cloud project, then enable the Google Play Android Developer API. Google no longer requires you to link that Cloud project to the Play developer account.
Follow Google's Developer API setup for the current steps.
Create a service account
In Google Cloud, create a service account and a JSON key. Keep the downloaded key private.
In Play Console, open Users and permissions, invite the service account email, and grant it these permissions:
- View financial data, orders, and cancellation survey responses
- Manage orders and subscriptions
Scope the access to the app where possible.
Add the provider in Voidhash
In Studio, open Settings → Payment providers → Google Play. Enter the Android application ID
from Gradle, such as com.example.app, then upload the service account JSON key.
Save the configuration and enable the provider.
Connect products
Open each Voidhash product and add the matching Google Play subscription product and the base plan that should be available in the app. To sell a developer offer on that base plan from a paywall, add it under Offers; see Offer a discount.
Real-time developer notifications
Real-time developer notifications (RTDN) keep subscription state current even when the app is not running. Google publishes them to a Pub/Sub topic that you own, and a push subscription delivers them to Voidhash. Save the provider with its service account key first, then:
- Create a Pub/Sub topic in Google Cloud.
- Grant
google-play-developer-notifications@system.gserviceaccount.comthe Pub/Sub Publisher role on that topic. - In Play Console, open Monetize → Monetization setup, check
Enable real-time notifications, enter the full topic name
(
projects/{project_id}/topics/{topic_name}), choose Get all notifications for subscriptions and one-time products, and save. - Enter the same topic name in Google Play RTDN topic name in Voidhash.
- Copy the RTDN push endpoint URL from the provider's Google developer notifications tab.
- Create a Push subscription on the topic with that URL as its endpoint. Enable authentication with the service account whose key you uploaded, and leave the audience empty.
- Click Send Test Message in Play Console and confirm the subscription has no unacknowledged messages.
Set up real-time developer notifications walks through each step, the required Google Cloud permissions, and troubleshooting.
The provider also has an optional Raw Google events forwarding URL. Set it when your backend needs its own copy of each notification; see Forward Google Play notifications.
Verify
- Publish the app to an internal test track.
- Add the tester account and install the Play-distributed build.
- Confirm
useProducts()returns the expected localized product. - Complete a test purchase and check for an active grant in
useCurrentPerson(). - Send an RTDN test message and confirm the push subscription acknowledges it.
Google Play Billing behavior depends on the installed package, signing key, tester account, and track. A locally sideloaded build is not a reliable end-to-end subscription test.
A tester's purchase also unlocks access in your published app by default, on any track. To count only real purchases there, see Sandbox purchases in your published app.