Set up the Google console
Overview
To publish your app on Google Play, you must check several values in Google Play Console and Google Cloud Console and register them in the Hive Console. This document describes where and how to check each value and the Hive Console screens where you register the values. The related console guides explain how to enter and save the values on the console screens.
Register the store App ID
The package name is the value Google Play uses to identify your app. Hive Axyl integrates with Google Play based on this value to handle login, payment, and more, so register it before you set up login integration and payment integration.
Go to Google Play Console and check the package name of the target app.
Register the package name in Store App ID of the App ID that you created with the Google Play store in Project Settings > App ID of the Hive Console. For how to register it, see Register the store App ID.
Login integration
Google login and Google Play Games login are different login methods. Prepare OAuth 2.0 clients in Google Cloud Console according to the login methods your app will provide. If you use Google Play Games login, also configure Play Games Services in Google Play Console.
Both login methods require a Web application type client. If you provide Google login on Android or use Google Play Games login, also prepare an Android type client to verify the app signature.
1. Check the Google login credentials
The Hive Axyl server verifies Google login results with the credentials of a Web application type OAuth 2.0 client. If you provide Google login on Android, you must also create an Android type client to verify the app signature.
- Open Google Cloud Console, select the cloud project where you will create the OAuth client, and go to APIs & Services > Credentials.
- Select a Web application type client from the OAuth 2.0 Client IDs list. If there is no client, select Create credentials > OAuth client ID and create one with Web application as the application type.
- If you also provide Google login in runtime environments other than Android, add the redirect URI that the app will use to Authorized redirect URIs.
- Copy the value shown in Client ID.
- Copy the value shown in Client secret.
-
If you provide Google login on Android, select Create credentials > OAuth client ID and create one more client with Android as the application type. When you do, enter the app's package name and the SHA-1 certificate fingerprint of the signing key. If the signing keys for debug builds and release builds differ, register each fingerprint.
Google Play services verifies the Android type client directly with the app's package name and signature.
2. Check the Google Play Games login credentials
Google Play Games login requires settings in both Google Cloud Console and Google Play Console. In Google Cloud Console, prepare a Web application type client and an Android type client to verify the app signature. In Google Play Console, connect the two clients to Play Games Services.
- Open Google Cloud Console and go to APIs & Services > Credentials.
-
Check the Android type client in the OAuth 2.0 Client IDs list. If there is no client, select Create credentials > OAuth client ID and create one with Android as the application type. When you do, enter the app's package name and the SHA-1 certificate fingerprint of the signing key.
-
Select a Web application type client from the same list. If there is no client, specify Web application as the application type when you create a new OAuth client.
- In Authorized redirect URIs of this client, register the URL you decided on in Prepare the app server redirect URI. The value you pass as
RedirectUriin code must match the registered value. - Copy the Client ID and the Client secret.
- Open Google Play Console and go to Play Games Services > Setup and management > Configuration.
- If this is your first setup, start configuring Play Games Services, and copy the Games services project ID shown on the screen. You use this value in the app's Android resources.
- Select the cloud project where you created the OAuth clients. Play Games Services and the OAuth clients must belong to the same cloud project to be connected to each other.
- Register the Android type client you checked earlier in the credentials of Play Games Services.
-
Link the Web application type client you copied earlier to the same credentials. If you do not link it, authorization code requests for server exchange fail.
3. Go to the Hive Console settings
Register and enable the credentials that match the login method.
Payment integration
Google Play payment works as follows: after the user completes a payment, the Hive Axyl server verifies the receipt with a Google Play service account key. For Google Play payment to work, you must check the credentials used for verification and the information of the products to sell in the Google consoles and register them in the Hive Console. If you do not sell subscription products, skip step 4.
1. Check the License Key
The License Key is the in-app billing license key that Google Play issues for each app.
- Open Google Play Console and select the target app.
- Go to Monetize > Monetization setup > Licensing.
-
Copy the license key shown.
2. Issue a service account key
The service account key is the credential that the Hive Axyl server uses when it asks Google Play to check receipts, and it is issued as a JSON file.
- Open Google Cloud Console and select the Google Play Android Developer project. If there is no project, first create one on the API access page of Google Play Console.
- Go to IAM & Admin > Service Accounts.
- Select the service account to use, and then go to the Keys tab.
-
Select Add key, select JSON as the key type, and then select Create to download the JSON file.
You cannot download the JSON file again from this screen. If you lose the file, you must issue a new key and register it in the Hive Console again.
3. Register products to sell and check product IDs
Hive Axyl retrieves the product information registered in Google Play by using the product IDs registered in the Hive Console. Therefore, the product IDs registered in Google Play Console and the product IDs to register in the Hive Console must be the same.
In Google Play Console, register the in-app products or subscription products to sell, and check their product IDs.
4. Set up subscription notifications in the Google consoles
If you sell subscription products, create a Pub/Sub topic and subscription in Google Cloud Console and turn on real-time developer notifications in Google Play Console so that Google Play sends subscription status change notifications to the Hive Axyl server.
- In Google Cloud Console, select the project where you issued the service account key, and enable Cloud Pub/Sub API in APIs & Services > Library.
- Go to Pub/Sub > Topics and create a new topic to receive notifications.
- Select the topic you created, and on the Permissions tab, grant the Pub/Sub Publisher role to the
google-play-developer-notifications@system.gserviceaccount.comservice account. Without this permission, Google Play cannot publish notifications to the topic. - Go to Pub/Sub > Subscriptions and create a new subscription for the topic you created earlier. If you already have a subscription, you can instead select it and go to Edit subscription.
-
Select Push for Delivery type, and enter
https://api.hiveaxyl.com/payment/v1/webhook/subscription/googlein Push endpoint. -
Open Google Play Console, select the target app, and go to Monetize > Monetization setup.
- In Real-time developer notifications, turn on Enable real-time notifications.
- In Topic name, enter the name of the topic you created earlier in the
projects/{project_id}/topics/{topic_name}format. - Select Send test message to check that notifications are delivered correctly.
- Select Save changes.
5. Register in the Hive Console
Register the values you checked in the Google consoles in the following locations. The Hive Axyl server verifies receipts with the credentials registered in Store Settings and retrieves Google Play product information with the product IDs registered in Product Registration.
| Value checked in the Google consoles | Where to register in the Hive Console | How to register |
|---|---|---|
| License Key, service account key JSON file | Google Play card in Payment > Store Settings | Google Play credentials |
| Product ID | Payment > Product Registration | Product registration |
Register the service account key JSON file in Google Market Account. When you register products, select Google Play for Payment platform. Because the actual payment price of Google Play products is managed in Google Play Console, the price entered in the Hive Console does not affect the payment amount.
If you use different credentials for each App ID, register them individually as described in Configure credentials per App ID.
If you sell subscription products, also register the URL of the app server that will receive subscription status change notifications in Payment > Subscription Server Notification URL. For how to register it, see Subscription server notification URL. If you do not have an app server to receive notifications yet, first register a server in App server.
Push notification integration
Google Play push notifications are sent using Firebase Cloud Messaging (FCM). To use push notifications in an Android app, you must prepare FCM integration information in the Firebase console.
Prepare the Google FCM (Firebase Cloud Messaging) authentication key in the following order.
1. Check the project ID
Select the project that will use push notifications in the Firebase console. Check the project ID of the selected project.
- Open the Firebase console and select the project.
- Go to Project settings > General.
- Copy the value shown in Project ID.
2. Issue the service key file
In the Firebase console, issue the service key file that the Hive Axyl push notification server uses to access FCM.
- Go to Project settings > Service accounts.
- Select Generate new private key.
- Generate the key in the prompt window.
- Download the generated JSON file.
Keep the issued file in a safe place. If you lose the file, generate a new private key.
3. Register in the Hive Console
To configure FCM as a push notification method, go to Push > Push Settings. Register the values you checked in the Hive Console.
| Value prepared in the Firebase console | Where to register in the Hive Console |
|---|---|
| Project ID | FCM settings in Push > Push Settings |
| Service Key file | FCM settings in Push > Push Settings |
Enter the Project ID.
Upload the downloaded JSON Service Key file and select Save.