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. Select the base plan or offer that should be available in the app.

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. To configure it:

  1. Create a Pub/Sub topic in Google Cloud.
  2. Grant google-play-developer-notifications@system.gserviceaccount.com the Pub/Sub Publisher role on that topic.
  3. In Play Console, open Monetize → Monetization setup and enable real-time notifications.
  4. Enter the full topic name: projects/{project_id}/topics/{topic_name}.
  5. Send a test message, then save.
  6. Enter the same topic name in the provider's optional RTDN field in Voidhash.

Google's Play Billing setup guide has the current Pub/Sub instructions.

The provider also has an optional forwarding URL. Use it only when your backend needs a copy of the raw Google event.

Verify

  1. Publish the app to an internal test track.
  2. Add the tester account and install the Play-distributed build.
  3. Confirm useProducts() returns the expected localized product.
  4. Complete a test purchase and check for an active grant in useCurrentPerson().
  5. Send an RTDN test message and verify the provider remains healthy.

Test with a Play-distributed build

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.