VoidhashDocs
DocumentationAPI reference
Dashboard
Get started
Introduction
Quickstart
Setup
Setup overview
Create a project
Products and perks
Paywall locations
CLI
Paywall components
Components
Develop a component
Editor panels
Component definition
Publishing
Installing and capabilities
Mobile SDKs
Swift
Kotlin
React Native
Store setup
Connect the App Store
Connect Google Play
API libraries
Node.js
PHP
Rust
Go
Resources
MCP server
Migrate in observer mode
Delete a person's data

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:

  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, 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.
  4. Enter the same topic name in Google Play RTDN topic name in Voidhash.
  5. Copy the RTDN push endpoint URL from the provider's Google developer notifications tab.
  6. 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.
  7. 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

  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 confirm the push subscription acknowledges it.
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.

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.

PreviousConnect the App StoreNextNode.js library

On this page

Configure API accessEnable the Developer APICreate a service accountAdd the provider in VoidhashConnect productsReal-time developer notificationsVerify