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 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.

GooglePlay-Setup000

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 identifier below your app name into the Receipt Validator Dashboard

GooglePlay-Setup010

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 Cloud
  • Make sure you are signed in with your Google Play Developer Account
  • Create a new Google Play Console Developer project

GooglePlay-Setup020

  • Go back and select the newly created project
  • Navigate to IAM & Admin > Service Accounts
  • Click on CREATE SERVICE ACCOUNT

GooglePlay-Setup030

  • Enter the required fields and click on CREATE AND CONTINUE

GooglePlay-Setup040

  • Skip assigning any permission to the service account and click DONE
  • On your newly created service account, navigate to Actions > Manage Keys

GooglePlay-Setup060

  • Add a new key for this service account

GooglePlay-Setup070

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

GooglePlay-Setup080

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

GooglePlay-Setup090

  • Go back and navigate to APIs & Services
  • Click on ENABLE APIS AND SERVICES

GooglePlay-Setup110

  • Search for and enable the Google Play Android Developer API

GooglePlay-Setup120

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 > Users and permissions
  • Click on Invite new users

GooglePlay-Setup130

  • Enter the email of your newly created Service Account
  • Under App permissions, select the desired application
  • Add the following three permissions. All other permissions can stay disabled
  • Click on Apply and Invite user

GooglePlay-Setup140

  • Confirm by clicking Send invitation

GooglePlay-Setup150

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 Receipt Validator Dashboard's 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.

GooglePlay-Setup160

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

GooglePlay-Setup200

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

GooglePlay-Setup210 GooglePlay-Setup220

  • Open the Subscriptions category
  • Edit the subscription

GooglePlay-Setup230

  • 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

GooglePlay-Setup240

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

GooglePlay-Setup250

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

GooglePlay-Setup260

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

GooglePlay-Setup270

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

GooglePlay-Setup280

Done!