Google Play
Last updated
Was this helpful?
Last updated
Was this helpful?
To initialize the service, call the startAutoTracking
method of the DTDPurchases
interface. Call the method after the SDK initialization call:
The SDK will automatically restore the list of previously purchased subscriptions at the first launch of the autotracking service. No additional integration is required.
Go to the Library section.
Find the Google Play Developer API section.
Press ENABLE
to enable the Google Play Androd Developer API.
Select the project to link the service account and where you will collect subscription data later. Create a new project if it is not in the list.
In the list of available service keys, click CREATE SERVICE ACCOUNT
.
Fill in the Service account name field. The Service Account ID field will be filled in automatically (use the screenshot below as an example) and click CREATE AND CONTINUE
.
Skip the optional steps 2-3 and click DONE
at the end of the form.
Select the project where you would like to collect subscription data. Click CREATE TOPIC
.
To create a topic: fill in the Topic ID (use the screenshot below as an example), disable Add a default subscription option (1) and click CREATE
(2).
Select a topic, click on three dots and select View permissions.
Click ADD PRINCIPAL
to add the service account.
Add the google-play-developer-notifications@system.gserviceaccount.com
service account and grant it the role of Pub/Sub Publisher. Save the changes.
Open the list of subscriptions and click CREATE SUBSCRIPTION
.
In the appeared form:
Specify the Subscription ID (1).
Fill in the Topic name in Select a Cloud Pub/Sub topic field (2).
In the Delivery type select Push (3).
Copy Endpoint URL from devtodev (see steps 8-9) and insert it in the Endpoint URL field (4). All other parameters remain unchanged. Save the changes.
Copy the Endpoint URL and paste it in the corresponding field in Google Cloud (step 7).
Go to Settings → Payments integration → IAP auto tracking and click edit
(3).
Fill in the integration form with the data obtained earlier:
Android App ID
Click Save
.
When the integration is complete, the status will change to Active.
If you use subscriptions, go to Payments integration → Subscriptions and click Integrate
.
In the Users and permissions section, you can add users and manage their permissions.
Go to Users and permissions.
Click Invite new users
.
Add your service account email in the Email address field (1).
In the Permissions section (2) select the apps (3) accessible to the service account. Click Apply
(5).
Grant permissions to individual apps, or use account permissions to grant access to all apps in your developer account.
Grant the necessary rights to perform actions (see next step Account permissions).
Open Account permissions tab. Grant the following permissions:
View app information (1)
View app quality information (2)
View financial data (3)
Click Apply
to confirm.
Click Invite user
to finish the user setup.
Go to the app’s Monetise with Play → Monetisation setup section.
Enter the full name of the topic in the Topic name field.
Tick the Enable real-time notifications checkbox.
Send a test notification using the link below (4). If everything is configured correctly, the test notification will change the integration status of the Subscriptions in devtodev to Active (Settings → Payments integration → Subscriptions → Market connection).
Click Save changes
to finish the setup.
If you have already activated the and set up a to work with devtodev, you can skip this section and proceed to .
Go to under your Google account. Select the project (1) for which you want to configure Google Play Developer API. Then go to the APIs and services section (2).
Go to the section.
After creating a service account, you will be returned to the available Service accounts list.
Select the created account and open the KEYS tab (1), click ADD KEY
(2), and then select the JSON key type option (3) in the pop-up window.
Click CREATE
to confirm your choice.
The generated private key file will be downloaded automatically. You will need to upload this key to devtodev later in the following steps (see ).
Go to the IAM section (1) in the Permissions tab and click GRANT ACCESS
(2) to add roles to the service account.
In the New principals section (3), enter the service account address and grant it the Pub/Sub Subscriber role (4).
If you do not have this role, you need to activate the Pub/Sub service in the Cloud Console ().
Save the changes (5).
Go to the in the Pub/Sub service.
To get Endpoint URL, go to , select the same app and open app settings (Settings → Payments integration → Subscriptions). Click Integrate
.
Upload the Private key file obtained in step.
Upload the Private key file obtained in step (1).
Specify Android App ID (2).
Add all existing subscriptions, specifying the bundle, subscription period, and name for each subscription.
Click Save
(3) to finish integration.
To set up user permission, you need to log into your Google Play Console account and invite your .
Sign into the .
Add as a new user:
After in the Pub/Sub service, you'll need to register the created topic as a target for Real-time developer notifications (RTDN).