Create In App Purchases for Android

Overview

  • Create your Google Play Store listing
  • Get your billing key
  • Create a manifest.json file, add billing key, and add to your app on myapppresser.com
  • Build your app with a release key
  • Create a beta release on Google Play and upload your app .aab
  • Create your in app purchase

For Android you must first create a store listing for your app on the Google Play store.

Get Your Billing Key

First, setup your merchant account with Google Play.

Next, login to the Google Play dashboard, and click your app. Scroll down in the menu underneath Products, and click Monetization Setup. Copy the license key you see in the image below.

If you do not see a billing key, you may need to setup your billing profile first.

Manifest.json File

Create a new file called manifest.json. Add this code:

{ "play_store_key": "MIIBIjANBgkqhkXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" }

Replace the key with your billing key and save the file. 

Next, visit your app dashboard, click Features => In App Purchases, and upload your manifest.json file as shown.

Upload .aab to Google Play store with billing permissions

You must upload an .aab with billing permissions, to do that you just need to add the In App Purchase plugin to your app and rebuild for the app store.

Visit your App Customizer, click the Build and Preview Tab. Expand the device builds, choose Submit to Google Play, and Build.

You should receive an email with a link to download the signed .aab file, this is what you will upload to the Google Play Store.

Create a New Test Release

In order to complete in app purchase setup, you must next upload a test app to Google Play. This will not be available publicly, it is only for IAP setup.

In the Google Play store, click on your app, then go to Release Management => App Releases. 

Here you can choose a type of release, Internal is recommended, but any release is acceptable. Click create release or manage releases. Create a new release, add your email to the list of testers, and upload your aab there.

Create the In App Purchase

Go to your publishing dashboard, and click on your app. Expand "Store Presence" and click on In App Products.

You may be prompted to setup a billing profile, you will need to be approved before you can add a purchase.

To create a subscription, you must click the "Subscriptions" tab. Click the blue button to create a purchase or subscription.

For Product ID, it's easiest if you use the same ID as iOS. For example, "membersubscription" like we used above.  It's ok if you used a different ID, just make sure you setup the form correctly in the app with 2 different IDs.

Fill out the fields and set the purchase to Active.

When you are testing in app purchases, you must use a signed version of the app. The easiest way to do this is to publish your app to a Beta release with open testing. You will be able to get a link that anyone can visit and download the app for testing.

Proceed to add the purchase form in your app.