Skip to main content

Google Play

Setup Instructions

Google Play Store integration requires data from your application in Google Play Console. Also, a project on Google Cloud is necessary for authenticating and accessing your Google Play app backend, in order to send receipt validation requests. If you are offering subscriptions, enabling Real-time developer notifications, delivering updates about subscription states and expirations to the Receipt Validation backend in realtime, is required as well.

note

Note that the initial setup and configuration of your project in Google Cloud could take up to 24 hours for it to successfully establish a connection to the Google Play API. In the meantime receipt validation requests will still fail.

note

Note that Google Real-time developer notifications using the Pub/Sub service [https://cloud.google.com/pubsub/pricing](are not completely free), however there is a free contingent of 10 TiB per month, which should be sufficient to process millions of messages every month. It is unlikely that your app receives that many messages, except if you have hundreds of thousands in-app purchases as well.

In the following screenshot, you can see the required fields we are going to fill out. Open your App Setup to get started.

000

Bundle ID

The Bundle ID is displayed when editing your application in Google Play Console.

  • Navigate to All apps > Your App > Dashboard
  • Copy-paste the value below your app name

010

Account ID

For the Receipt Validator service to work, a service account needs to be created that can access your account with financial permissions for receipt validation.

  • Navigate to Google Play Console > Setup > API access
  • If there is no linked Google Cloud project yet, create and link a new Google Play Console Developer project
  • Click on Create new service account

020

  • In the popup that is displayed, click on the Google Cloud Platform link
  • In Google Cloud and within the IAM and admin section, click on CREATE SERVICE ACCOUNT

030

  • Enter the required fields and click on CREATE AND CONTINUE

040

  • Grant Owner permission to the service account and click DONE

050

  • On your newly created service account, navigate to Actions > Manage Keys

060

  • Add a new key for this service account

070

  • Keep JSON selected and click CREATE
  • By pressing the button, a *.json key file will be downloaded in your browser

080

  • Open the downloaded *.json key file
  • Copy-paste the value for client_email into the Account Name field, without quotation marks

090

You have finished all necessary steps in the Google Cloud Console for this step. However, your service account can still not access your Google Play financial data due to missing permissions. Let's assign the Google Play permissions next.

  • Navigate to Google Play Console > Setup > API access
  • If you cannot see your newly created service account, click on Refresh service accounts
  • Click on Grant access

100

  • Select the following three permissions. All other permissions can be disabled
  • Click on Invite user

110

  • Confirm by clicking Send invitation

120

  • Click on the service account that should now show up as Active

130

  • Grant permission to your app
  • Click on Apply (and again for confirmation)

140

License Key

In the last step, we have created and downloaded a new key for the service account in Google Cloud. Note that the key can only be downloaded once, so make sure to save it on a secure location.

  • Open the downloaded *.json key file
  • Copy-paste the value for private_key into the Secret Key field, without quotation marks

To repeat, the full key should go into that field, including the -----BEGIN... -----END... parts and all line breaks inbetween.

150

Server Notifications

Required when offering subscriptions. The Server URL is the same for Production and Sandbox.

  • Enable Google Pub/Sub for your Google Cloud project by searching in the navigation menu or using this link

200

  • Open the Pub/Sub submenu or use this link
  • Create a new topic with a default subscription

210 220

  • Open the Subscriptions category
  • Edit the subscription

230

  • Make sure the Delivery type is set to Push and Expiry period is Never expire
  • In the Endpoint URL input field, enter the following URL and save by clicking on Update

240

https://flobuk.com/validator/v1/webhook/{YourAppID}/google

Replace {YourAppID} with the app ID value found on your Receipt Validator app page.

  • Go back to the Subscriptions list
  • Click on Actions > View permissions, a panel to the right is displayed
  • Click on ADD PRINCIPAL

250

  • As principal, add the Account ID value from a previous step of this guide
  • For the role, select Pub/Sub Editor
  • Click on SAVE

260

  • Go back to the Topics list
  • Copy the Topic name value for your working topic

270

Finally, we have to tell your app in Google Play that it should use the recent topic.

  • Navigate to Google Play Console > All apps > Your App > Monetisation setup
  • In the input field for Topic name, paste the value you've copied in the last step
  • Click on Save changes

280

Done!