# Google Play Console

<div align="left"><figure><img src="https://727226624-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MjFmyReUsbJqDjHEAlW%2Fuploads%2FgwIJwL3wBjDk0JW25IHx%2Fplay-store.png?alt=media&#x26;token=d9c25687-08fd-4b21-91d8-3de6367c3984" alt=""><figcaption></figcaption></figure></div>

## Set up

### Navigate to the Integration settings view

1. Select an app in the top left corner from the Switcher
2. Navigate to **App Settings** by clicking the gear icon (⚙️) at the top of the Timeline sidebar
3. Click on **Integrations** in the sidebar

### **Connect to the Google Play Console**

1. Find the **Google Play** integration module under the **App store** section
2. Click the **Connect** button
3. Enter your app’s package name
4. Upload a service account key file (.json) configured with the correct permissions. See [How to create a service account for use in Runway](#how-to-create-a-service-account-for-use-in-runway) for details.

{% hint style="warning" %}
The Google Play Developer API can only be used to make changes to an existing app – you must have uploaded at least one APK or AAB through the Play Console before the Play Developer API can be used through Runway.
{% endhint %}

## How to create a service account for use in Runway

To connect Runway to the Google Play Console, you'll need a **Service Account** that's associated with a Google Cloud Project that has enabled access to the Google Play Developer API. The service account must also be granted access to your apps in the Play Console in order to work properly in Runway.

To help make the process of creating and setting up a service account easier, we've created a short [video tutorial](https://www.loom.com/share/e866c3d7ac094d95958d18b61c2e066e?sid=5eb4f1a6-6c51-4607-a576-0c71d9eefa0a) that demonstrates all the required steps described below.

### Prerequisites

Before you can create a service account, make sure you've created a Google Cloud Project with access to the Google Play Developer API. For instructions on how to do this, head to Google's documentation below:

[Creating a Google Cloud Project](https://developers.google.com/android-publisher/getting_started#creating)

[Enabling the Google Play Developer API](https://developers.google.com/android-publisher/getting_started#enable)

You can also choose to use an existing Google Cloud Project, just make sure the Google Play Developer API is enabled on the project you'd like to use.

### Creating a service account

Once you've created your Google Cloud Project and enabled the Google Play Developer API, you're ready to create a service account for use in Runway.

{% hint style="info" %}
Creating a new service account for Runway's exclusive use is highly recommended to avoid issues with rate limits.
{% endhint %}

{% hint style="warning" %}
The user creating the Service Account and key will need to have the [Create Service Accounts ](https://cloud.google.com/iam/docs/understanding-roles#iam.serviceAccountCreator)(`roles/iam.serviceAccountCreator`) IAM role on the Google Cloud project.
{% endhint %}

1. In the Google Cloud Console, go to [Service Accounts](https://console.cloud.google.com/projectselector2/iam-admin/serviceaccounts).
2. Select the Google Cloud Project you enabled the Google Play Developer API on in the previous step.
3. Click **+ Create Service Account**
4. Fill out the form for Step 1, then click **Create**
5. You can skip Steps 2 (granting the service account a specific role) and 3 (granting users access to the service account) and click **Done**

<figure><img src="https://727226624-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MjFmyReUsbJqDjHEAlW%2Fuploads%2FMtM8eLdLWAeLq6IicdUc%2FPlay%20Console%20-%20Create%20service%20account.png?alt=media&#x26;token=820296f2-008c-4277-b131-1983c6d46996" alt=""><figcaption></figcaption></figure>

1. You service account should appear in the list of service accounts on your project. On the service account you just created, click the three dots on the right hand side, and select **Manage keys**
2. Click **Add Key**, then **Create new key**
3. Select the **JSON** option and click **Create**
4. Your service account key file should start downloading. This is the file you'll need to upload to Runway so that it can access the Google Play Developer API.
5. Navigate back to the list of service accounts for your project and **copy the email address** of your newly created service account. You'll need this for the next step below.

### Grant your service account access to the Play Console

Before your service account can be used to make requests to the Google Play Developer API, it must be granted access to your apps in the Google Play Console.

1. Go to the [Google Play Console](https://play.google.com/console).
2. In the Google Play Console, navigate to **Users and permissions**.
3. In the **Users and permissions** page, click **Invite users** under the action menu on the far right.
4. In the **Invite user** form, paste the email address of your service account. Leave the **Access expiry** checkbox **unchecked.**

<figure><img src="https://727226624-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MjFmyReUsbJqDjHEAlW%2Fuploads%2FcogaAkljKVuaLzzxYvWH%2Fimage.png?alt=media&#x26;token=5bac7db5-dd2a-4123-b944-64bd4adc21e8" alt=""><figcaption></figcaption></figure>

5. Scroll down to **App permissions** and click **Add app**. Choose the apps you'd like to grant the service account access to. This should match the apps you'd like to connect in Runway.
6. When you select your apps, you'll be prompted to specify permissions you'd like the service account to have for that app. Add the necessary permissions (see below) and click **Apply.**

{% hint style="info" %}
Your service account must be granted the following permissions:

* **View app information (readonly)**
* **Manage store presence**
* **Release to production, exclude devices, and use Play App Signing**
* **Release apps to testing tracks**
* **Manage testing tracks and edit tester lists**
  {% endhint %}

7. Once you're done adding App permissions to your service account, click **Invite user.** Your service account should appear in the list of users.

{% hint style="info" %}
If you need to make changes to your service account's app permissions, click the arrow on your service account in **Users and permissions**, and then the arrow ("Manage permissions") on the app you'd like to update permissions for.
{% endhint %}

## Play Console release status limitations

Due to a long-standing [bug](https://issuetracker.google.com/issues/179708468) in the Play Console API, it’s impossible to tell whether a new app version is definitely released based on the API alone. As soon as a version is submitted on the prod track, its status as returned by the Play Console API changes immediately from “draft” to “in progress”, which is the terminal state for live releases. But if your app is pulled for review by Google, or if your team has managed publishing enabled in Play Console, the new version isn’t actually live at this point.

This limitation with the Play Console API has some implications when it comes to Runway functionality:

#### **Runway release status and notifications**

In general, Runway treats Android submission as release completion. You’ll see the ‘Submitted’ status on the Release step in Runway, and the release completion notification type is triggered by (and refers to) submission. Most of the Runway automations that are triggered upon release completion also run at submission time, though there are some exceptions which run upon rollout completion.

**‘Customized Android staged rollout’ automation**

Since Runway can’t know what time a release is actually live in the Play Store, it can’t know the correct time to start an automated rollout. The best Runway can do is start the automatic rollout upon submission, but this poses an issue if you have managed publishing enabled in Play Console or consistently get pulled for review by Google: there will be a gap between submission and actual go-live, and so the rollout start will be premature. For teams fitting one of those conditions (managed publishing enabled or consistent app reviews) we recommend that you choose one of the rollout start strategies other than **Start automatically on submission** for the ‘Customized Android staged rollout’ automation. See the automation’s [documentation](https://docs.runway.team/automations/types-of-automations#rollout-start-strategy) for more details.

### Play Console email forwarding workaround

Runway has developed a system that gets around the limitations described above. By setting up forwarding from an inbox on your team’s side that receives emails from Google about your apps, to a specially configured inbox on the Runway side, we can look for and interpret the specific emails Google sends when new versions actually go live and use that to establish true release status in Runway. Because Google sends identical emails for certain other non-release related changes in Play Console, Runway uses the broader context we have about your team's release cycles and timing at different stages to match emailed updates to releases, and to understand release status accordingly. See below for info on how to set up email forwarding.

## Email forwarding

You can set up forwarding from an inbox on your team’s side that receives emails from Google about your apps to a specially configured inbox on the Runway side. This allows you to work around [limitations in the Play Console API](#play-console-release-status-limitations), as well as have Google communications, such as app review rejection notices, forwarded into Slack or Teams by Runway (if you enable the corresponding notification type).

Specific steps to set up email forwarding will depend on your team’s email provider and any company-specific settings, but you’ll use the info below.

#### Forward emails from

Google sends developer communications from a number of different addresses, so **it is safest to forward from any addresses ending in google.com**. But if your team wishes to scope this more, here are the most commonly used Google addresses:

<noreply-play-developer-console@google.com>

<no-reply-googleplay-developer@google.com>

#### Forward emails to

`forwarding+<Forwarding ID>@runway.team`

The **Forwarding ID** to use will be surfaced in the Play Console integration module once you connect the integration.
