Google Play Service Credentials

Google Play Service Credentials

This is a difficult process but it is required in order for Apphud to validate in-app purchases in Google Play.

Enable Google Developer API

In Google Cloud Console go to Google Play Developer API page and make sure Google Play Android Developer API is enabled.

Creating a Service Account

In the side panel go to IAM & Admin -> Service Accounts.

Click on Create Service Account.

In the Service Account creation page enter Service Account name and click Create and Continue.

Grant this service account access to two Roles by selecting from the dropdown:

  • Pub/Sub Admin
  • Monitoring Viewer

Click Done

After service account is created, copy email of this account and store in a safe place. We will need this email later.

Next click on Actions button and select Manage keys.

Click on Add Key and select Create new key as on the screenshot below:

Select JSON format and click Create:

You will get JSON file on your computer. Store it in a safe place.

📘

Double Check

Make sure you copied email of the service account as mentioned above and you have JSON file downloaded on your computer.

Granting Permission in Google Play Console

After service account JSON is created, you need to grant permissions to your app(s).

Go to Users and Permissions page and click on Invite new users

Enter email address of the service account from previous steps to email address field:

in the App permissions tab select your app(s) and click Apply:

In the Account Permissions tab make sure you selected following permissions:

  • View app information (read-only)
  • View financial data
  • Manage orders and subscriptions

Click Apply

Click on Invite user

Upload Service Account JSON to Apphud

Upload Service Account JSON file or enter JSON contents to Apphud when creating new app or if you already have created app, then in "Settings > Android app settings" page:

2358

You're done!

📘

Important Note

Service account JSON will not start working immediately. It may take up to 24 hours for Google Servers to activate your service account.

However, there is a workaround to get service account validated sooner. Go to Google Play Console, open your app's Subscriptions or In-App Products pages, and make any change to any product or subscription. This action may trigger the service account to start functioning more quickly.

If this did not help, the service account should be ready within 24 hours regardless.

How to create one more topic in Google cloud (the URL of the service that receives push messages)

In the Google Console cloud, you can create another topic and set up sending webhooks to Apphud and other services.

You need to go to the Google Cloud console section, and then go to Pub/Sub > Subscriptions and create a Subscritipion with the Push type.

Select a Cloud Pub/Sub topic that should be already created for sending notifications to Apphud.

Select Push type and paste the URL of your server endpoint where you need to send the subscriprtion notifications.

Troubleshooting

If you believe you did everything right, but Apphud still shows "Invalid Service Account JSON or Package Name. Please check permissions." error, check the following:

  • Make sure you upload the APK file to Google Play for at least internal testing.
  • Allow up to 24 hours for Google Servers to activate your service account.