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.

RV-Google000.png

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

RV-Google010.png

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

RV-Google020.png

  • 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

RV-Google030.png

  • Enter the required fields and click on CREATE AND CONTINUE

RV-Google040.png

  • Grant Owner permission to the service account and click DONE

RV-Google050.png

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

RV-Google060.png

  • Add a new key for this service account

RV-Google070.png

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

RV-Google080.png

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

RV-Google090.png

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

RV-Google100.png

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

RV-Google110.png

  • Confirm by clicking Send invitation

RV-Google120.png

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

RV-Google130.png

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

RV-Google140.png

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.

RV-Google100.png

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

RV-Google200.png

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

RV-Google210.png RV-Google220.png

  • Open the Subscriptions category
  • Edit the subscription

RV-Google230.png

  • 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

RV-Google240.png

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

RV-Google250.png

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

RV-Google260.png

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

RV-Google270.png

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

RV-Google280.png

Celebrate!