General Information
If you want to offer in-app purchases in your Purple DS Android App you need to setup a connection between the Purple Manager and Google Play.
The setup requires 2 steps:
1. Setting up purchase validation (required once per Google Play account)
2. Setting up Real time developer notifications (required for each individual App)
Instructions
1. Purchase validation
Purchases are validated against the Google Play Store to protect against fraud.
Note: This setup has to be done once per Play Store account.
|
Setup
If there are points that are not clear please refer to the official Google Play documentation.
You will need to complete the following steps:
- Open the Google Play Console as the Google Play Developer Account owner
- In the menu navigate to Settings > Developer account > API access
- Accept the terms of service
Note: If you already setup API access before this step is optional - If no project is currently linked, you will be asked to Link existing project or Create new project
- Make the selection depending on if you already have a Google Cloud project that you want to link or create a new project
- Make the selection depending on if you already have a Google Cloud project that you want to link or create a new project
- Once the project has been linked, verify that there is a service account listed under Service accounts
- If no service account is listed, you need to create one by clicking on Create new service accountand follow the steps listed in the popup message
- When creating the service account, make sure to grant the role Project > Viewer in step 2 Grant this service account access to project
- After the account has been created, open the details for the new account
- In the Keys section first select Add key and then Create new key
- Choose JSON format and confirm with Create
- Download the JSON file and make sure to backup this file
- Return to the Google Play Console and click on Done
- The newly created service account should now be listed in the table
- Click on Grant access in the row of the new service account
- The Invite user screen opens
- Select only View app information and download bulk reports and View financial data permissions
- Confirm invite with Invite user and then Send invite
- If no service account is listed, you need to create one by clicking on Create new service accountand follow the steps listed in the popup message
- Go your team in the Purple Manager
- Click on settings
- Upload the downloaded JSON file to Google API Service Account and save
Note: It may be neccesary to open and save one in-app product/subscription in the Google Play console for the new settings to take effect. No changes need to be made to the product.
2. Real-time developer notifications
Real-time developer notifications (RTDN) is a mechanism to receive notifications from Google whenever there is a change in a user's entitlement within your app. These notifications allow us to react immediately to subscription state changes.
Note: You need to setup this to be able to use Google Play subscriptions with Purple Apps.
|
Setup:
Please complete the following steps:
- Go to https://console.cloud.google.com/cloudpubsub/topic/list
- Make sure to select the correct project in the project dropdown
- Make sure to select the correct project in the project dropdown
- Click on Create topic
- Enter a Topic ID and confirm with Create topic
- Use a name that references the app if you re-use the same Google Cloud project for multiple apps
- Use a name that references the app if you re-use the same Google Cloud project for multiple apps
- Switch to Subscriptions in the left side menu
- Click on Create subscription
- Enter a Subscription ID, e.g. the name of your Topic ID
- Select the previously created topic in Select a Cloud Pub/Sub topic
- Choose Push as Delivery type
- Enter the Endpoint URL depending on the environment you are using:
- Production: https://receipts.purplemanager.com/api/v1/notifications/google
- Staging: https://staging-receipts.purplemanager.com/api/v1/notifications/google
- For Retry policy select Retry after exponential backoff delay with the following values:
- Minimum backoff (seconds): 10
- Maximum backoff (seconds): 600
- Click on Create to create the subscription
- Configure permissions for you topic as described at:
https://developer.android.com/google/play/billing/getting-ready#grant-rights - Configure Real-time developer notifications for your app as described at:
https://developer.android.com/google/play/billing/getting-ready#enable-rtdn - After configuring the topic in the Google Play Console press Send test notification
- In the Purple Manager go to the App Status tab of the corresponding App
- RTDN Status should show the time when the test notification was triggered
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article