The stores

Set up Google Play

About 20 minutes the first time. Google needs a little more than Apple, because Play doesn’t sign purchases: Vend16 asks Google about each one, so it needs permission.

1Upload a build first

Play Console only lets you create products once a build that uses Play Billing is uploaded. Upload one to Testing, Internal testing (it doesn’t need to be finished). Play Billing adds the com.android.vending.BILLING permission for you.

Check Monetise with Play, Payments profile is set up too. Without one, nothing can be sold.

2Create your products

  1. In Play Console, choose your app, then Monetise with Play, Products.
  2. One-time products: create one with a Product ID (for example coins_100), a name, description and price, then activate it. Google doesn’t record whether it’s consumable: that’s up to your code, and it’s why your app tells Vend16 the type.
  3. Subscriptions: create one (for example pro_monthly), add a base plan with its billing period and price, and activate the base plan.

Use the same product IDs as on the App Store if you can. It keeps your code to one list.

3Create a service account

  1. In Google Cloud Console, pick or create a project.
  2. APIs and Services, Library: enable the Google Play Android Developer API.
  3. IAM and Admin, Service Accounts, Create service account. It needs no Google Cloud roles.
  4. Open it, then Keys, Add key, Create new key, JSON. A file downloads.

4Let it see your purchases

  1. In Play Console, go to Users and permissions and Invite new users.
  2. Enter the service account’s email address (it ends in iam.gserviceaccount.com).
  3. Under App permissions, add your app with View financial data and Manage orders and subscriptions. Send the invite.

Then, on your app’s Setup page in Vend16, paste the whole JSON file into Google Play service account and save. We encrypt it straight away.

New permissions can take a while to reach Google’s API. If purchases fail with a permissions error in the first hour, wait and try again.

5Turn on real-time notifications

This is how Vend16 hears about renewals, cancellations and refunds.

  1. In Google Cloud, open Pub/Sub, Topics, and create one, for example play-notifications.
  2. On the topic, Permissions, add google-play-developer-notifications@system.gserviceaccount.com with the role Pub/Sub Publisher.
  3. Create a subscription on the topic with delivery type Push. The endpoint is your Play notifications URL from your app’s Setup page in Vend16. It includes a secret, so copy it whole:
Play notifications URL
https://vend16.com/v1/notifications/google/app_your_app_id?secret=…
  1. Back in Play Console: Monetise with Play, Monetisation setup. Under Real-time developer notifications, enter the full topic name (projects/your-project/topics/play-notifications) and save.
  2. Click Send test notification. We accept it but don’t list it, so check it arrived in the subscription’s delivery metrics in Google Cloud.

6Add licence testers

  1. In Play Console (the account level, not the app), go to Settings, License testing, and add the Google accounts you test with.
  2. Add the same people to your internal testing track and install from its opt-in link. Their purchases are free and show under Sandbox in Vend16.

Next: make a test purchase.

Stuck? Email hello@spruik.co and a real person replies.