Android

DocsIn-App Purchases › Android

Last updated: 13 Jun 2019 / 4:37 PM / GMT

Our monetization platform features a fully developed integration for Android in-app purchases.


Connecting your InPlayer and Google Play Store accounts

First, log into your InPlayer dashboard on https://dashboard.inplayer.com.

Go to Settings, then to the Integrations tab, and click on In-App Integrations.

Click on Google Play.

Enter the Site Verification Token and the Android Service Key from your Google account, and click .

Your InPlayer and Google accounts are now integrated.

How to find the Site Verification Token and the Android Service Key

Site Verification Token

Go to https://www.google.com/webmasters/verification/home?pli=1
Click on .

Enter the following URL:
https://services.inplayer.com/v2/hooks/google-in-app/X/

The X in the URL needs to be changed with your InPlayer Account UUID.

For example, if your Account UUID is c0fe41ca-3cbb-7pc1-5147-3m8157611d8d, the URL you would need to use would be:
https://services.inplayer.com/v2/hooks/google-in-app/c0fe41ca-3cbb-7pc1-5147-3m8157611d8d/

To get the Account UUID, log into your InPlayer dashboard, click on your account name in the top right corner, and go to Account Details.

Your Account UUID will be listed on the page.

Enter the URL, and click .

On the new screen, go to the Alternate methods tab.

Select HTML file upload and the verification token will be displayed.

Copy the token, without the .html part, and paste it in the InPlayer dashboard.

Before you can verify the token in Google, you will need to also enter the Android Service Key in the InPlayer panel, and save the settings there.

Read on to learn how to get the service key.

Android Service Key

Go to https://console.cloud.google.com/home/dashboard

You need to create a new project and a topic.

Start by creating the new project.

From the left-hand menu, scroll down to Pub/Sub, and click on Topics.

Click on .

This enables API notifications to the InPlayer platform.
Next, click on .

Name the new topic inplayer-notifications and click .

Click the three dots icon on the new topic and go to Permissions.

Click on .

Under New members, add the following URL:
google-play-developer-notifications@system.gserviceaccount.com

Under Role, go to Pub/Sub, and select Pub/Sub Publisher.

The final setup should look like this:

Click .

Next, you need to create a service account.

Go to https://console.developers.google.com/projectselector2/apis/credentials?authuser=2&supportedpurview=project

Open the project you have created in the previous step.
Click on  and select Service Account Key.

Set up the new service account.
In Service account name, enter inplayer-notifications.

Under Role, go to Pub/Sub and select Pub/Sub Subscriber.

Under Key type, select JSON.
Click .

The file with the service key will be downloaded to your device.

Open the file in a text editor, copy the whole service key and paste in the InPlayer dashboard.

Once you have both the Site Verification Token and the Android Service Key in the InPlayer dashboard, click .

You can now go back to the Google Webmaster Central and verify the Site Verification token as well.

Once you verify the token, you now need to verify this same domain in the Google Cloud Console as well.

For this, copy the domain from the Google Webmaster Central, without the https:// part.

Go back to https://console.cloud.google.com/home/dashboard, and from the left-hand menu, go to API & Services and then to Credentials.
Go to the Domain verification tab and click on .

Here, you need to enter the domain you have verified in the Google Webmaster Central.
Paste the copied domain (without the https:// part) and click .

The verified domain will show up.

Now you need to create a new subscription.
Go to the Pub/Sub section of the Google Cloud Console, open the topic you’ve created previously and click .

Set up the new subscription.

Give it a name.

Under Delivery Type choose Push, and in Endpoint paste the following URL:

https://services.inplayer.com/v2/hooks/google-in-app/X/

The X in the URL needs to be changed with your InPlayer Account UUID, just like it was described above, in the Site Verification Token section of this guide.

Under Subscription expiry choose Never Expire.
Click .

Next, go to https://play.google.com/apps/publish/signup/

Open your Google app.

Go to the Users & permissions section.

Click on .

For the name of the new user, use the “client_email”: value in the Service Key you’ve downloaded previously.
It will look something like this:
inplayer-notifications@thermal-micron-242818.iam.gserviceaccount.com

Set up the following permissions:

Next, go to Services & APIs.

Use the inplayer-notifications topic you’ve created previously.

Send a test, and save it.

Creating your InPlayer asset

The next step is to create your InPlayer asset.

We offer several different types of assets, so make sure to look at this section for instructions on how to create the correct asset type, depending on your content.

Creating the Google Play product

Next, you need to create the Google Play product. This is going to be the Google Play Store counterpart to the price option you have previously set up for your InPlayer asset.

To do this, log into your Google Play console.

Open your Google app.

Creating a PPV product

From the left-hand menu, go to In-app products, and then to Managed products.

Click on .

Set up the new managed product.

In the Product ID field, enter the Product ID of the price option for the InPlayer asset you are monetizing.

To get the Product ID, go to the Assets tab of your InPlayer dashboard and open the asset you wish to use. Go to Price Options, and click the  button next to the price option for which you are creating the in-app purchase.

Paste the Product ID into the Product ID field in the Google Player Store.

Fill out the rest of the product details.

Set up the pricing.

Remember to use the same price, as the one you’ve set up in the InPlayer merchant panel.

Note also that the default price here will be in USD, so make sure to take that into account.

When you finish with everything, review your work, and click .

And with that, you are done.

Creating a Subscription product

From the left-hand menu, go to In-app products, and then to Subscriptions.

Click on .

Set up the new subscription.

In the Product ID field, enter the Product ID of the price option for the InPlayer asset you are monetizing.

To get the Product ID, go to the Assets tab of your InPlayer dashboard and open the asset you wish to use. Go to Price Options, and click the  button next to the price option for which you are creating the in-app purchase.

Paste the Product ID into the Product ID field in the Google Player Store.

Fill out the rest of the product details.

Set up the pricing.

Remember to use the same price and billing period here, as the ones you’ve set up in the InPlayer merchant panel.

Note that the default price here will be in USD, so make sure to take that into account.

Set the Grace Period to None.
When you finish with everything, review your work, and click .

And with that, you are done.

If you have any questions in regards to any of this, don’t hesitate to contact us on support@inplayer.com.

We use cookies to analyse our traffic. We also share information about your use of our site with our analytics partners. See details