In-App Purchase Setup in Android Google Play Apps

December 23, 2020
|
Jigar Brahmbhatt
A person holds an Android phone

Adding in-app purchases and subscriptions to your Android app on the Google Play store has a number of required steps to get up and running.  Google uses its Google Play Billing System to provide In-App Purchases (IAPs) which you’ll need to get set up correctly.  In this article we’ll walk through how to:

  • Set up your app in the Google Play Console for in-app purchases and subscriptions
  • Create an app release
  • Add app testers and make sure they can make in-app purchases without getting charged
  • Add the Google Play Billing library as a dependency to your app

After setting your app up to support IAPs and subscriptions, if you need help with managing some of the more complex parts of the purchase process such as purchase token verification, creating paywalls, and managing the subscription lifecycle with Google’s Real-Time Developer Notifications, see how Nami can help by clicking the banner below.

Google Play Account Registration

If you do not have a Google Play Developer account, the first step you’ll need to do is register for an account and pay the fees.  Please note that the Public developer name you enter will be visible on the Google Play Store for any app you release, so make sure you choose either your personal name or business entity that you would like to be displayed.

Google Play Console developer account creation screenshot

Create a Payments Profile

In order to earn money on the Google Play store, you must have a payments profile setup.  To create this profile, simple navigate to Settings > Developer Account > Payment settings in the Google Play Console.  Click Create payments profile to get started and follow the rest of the steps.  For more details on this process, check out Google’s documentation.

Google Play Console payments profile screenshot

Create your App

Click All apps in the left navigation and then click on the Create app button.  Enter the name of your app, remembering this is how it will appear to all users on the Play store, select a default language, select App or Game, and select Paid from the Free or paid section.  Then check the boxes to agree to the Play Store agreements and click the Create app button at the bottom of the screen.

Google Play Console create app screenshot

After completing this first screen, you should end up on your app’s Dashboard screen.  If you are not there currently or previously had created your app in the Play Console, head to the All apps section and select your app from the list to get to the Dashboard screen.  On the Dashboard screen you should see a list of tasks that need to be completed.

Google Play Console set up app screenshot

Click on each task and provide any required information.  Once they are all completed you should see checkmarks next to each one.

Add the Play Billing library to your App

Your app must have the Play Billing library as a dependency in your project in order to use in-app purchases.  You’ll need to add this to the dependencies section of your build.gradle file.   For java apps, that will look like this:

If your app is written in Kotlin there is a different version of the library you need to include:

Create an App Release

First, you’ll need to generate a signed release for your app.  There are a few steps involved in this which you can read in Google’s documentation.  Once you’ve complete this, go to Release > Testing > Internal testing in the left navigation and click the Create new release button.

Google Play Console internal testing screenshot

Upload the signed APK or Android app bundle you created following the instructions in the link to Google’s documentation above and then click Start rollout to internal testing.

Add App Testers

It is very important in testing tracks to add and enable testers for your app.  This will allow users to find and install the app while it is only available for testing on not available for general release on the Play Store.

This is a 2-step process.  First, you’ll register a testing group and then add individual testers to the group.  Go to Release > Testing > Internal testing on the left navigation and then select the Testers tab.

Google Play Console internal testers screenshot

Click Create email list.

  • Choose a name that will make sense for your app testers for your reference.
  • Add the email addresses for each user’s Google account that they have linked to their Android test device.
  • Save changes.
  • Click the Copy link button under the section How testers join your test.
  • Send this link to each of your testers.  They must then open the link and click Accept Invite
Google Play app tester invitation screenshot
Example of the accept invitation page that each tester will receive.

Example of the accept invitation page that each tester will receive.

Add IAP Testers

There is one other very important testing permission to set. After you add users as app testers they need a separate permission to be able to test in-app purchases without incurring any charges to their account.  You’ll find this under Settings > License testing in the left navigation.

Add the same email address that is linked to a Google account for each user you added above in this section and click the Save changes button.

Google Play Console license testing screenshot

Set Up an In-App Purchase Subscription Product

Now that you’ve completed the setup of your app on the Play Console for in-app purchases and added the billing permissions to your app itself, the last step is to create an in-app purchase product.  In this example, we’ll create a subscription.  Go to Monetize > Products > Subscriptions in the left navigation.

Google Play console manage subscriptions screenshot

Now click the Create subscription button on the right side of the screen.  Fill in the information on the next screen including a Product ID (you’ll reference this in your app code), a Name and Description, Price, and Billing Period.  Then click the Save button.

Google Play Console create subscriber product screenshot

Note that once you create a Product ID it cannot be changed or reused, so choose a name carefully.  

A common practice is to use a reverse url structure with your app name.  You may also want to include the price point if you anticipate testing different price points for your app in the future.  An example might be com.namiml.demoApp.monthlySub.299.

Integrating your subscription product into your app is beyond the scope of this article.  You can find more details in Google’s documentation and in Nami ML’s SDK setup instructions.

Confirm Purchase Testing is Working

Finally, let’s start up your app with an integrated purchase process and try to buy a product to confirm that you are able to make purchases as a tester and not get charged.  If you have set up your email address correctly as a tester, when the Google Play bottom dialog opens up to complete the purchase in your app, next to the GPay information it should say Test card, always approves.  

Android Phone test subscrpition purchase screenshot

If it does, then you will not be charged for the purchase.  If you see details on another payment method at this point, try clicking on the payment method and see if the Test card, always approves option is available and select it.  

If this option is not available, there are 2 things you should check:

  • Are you signed in to the correct Google account on your device or in the emulator?
  • Does the account you have signed in as match the invite you received to be a tester that was added following the steps above?

As long as both of these are true, you should be all set.

Now you should be all set for testing and making in-app purchases in your Google Play store Android app.

Sign up to our newsletter

Get the latest articles delivered straight to your inbox.
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
Nami logo white

Focus on your app experience

We'll handle the subscriptions.

Portrait photo of blog author
Jigar Brahmbhatt

Jigar Brahmbhatt is a consulting Android Architect at Nami ML. His journey in the world of Android dates back to 2012 when the Android SDK he worked on shipped to millions of users of top US brick-and-mortar retailer apps.  Since then, he has been building top-class Android apps and SDKs in areas like chatbots to banking and e-commerce.

Similar articles

Read similar articles to this one

Quotes mark

Testimonials

Some client stories

"We spent hours researching the best ways to implement subscriptions and after many failed attempts we found Nami. We were able to go live with subscriptions in our Apple and Android apps in a matter of days."
Client portrait
Brian Pedone
Founder
Quiet Punch
Quiet Punch
"Nami helped us achieve a cross-platform solution for managing and sellingsubscriptions on Apple and Google. The Nami platform was flexible enough to handleour business requirements for in-app purchasing, allowing us to focus on our client'score domain and domain logic.”
Client Name
Client role
Company name
"Nami helped us achieve a cross-platform solution for managing and selling subscriptions on Apple and Google. The Nami platform was flexible enough to handle our business requirements for in-app purchasing, allowing us to focus on our client's core domain and domain logic."
Melody Morgan
Director, Engineering
Diamond
Diamond
"We spent hours researching the best ways to implement subscriptions and after many failed attempts we found Nami. We were able to go live with subscriptions in our Apple and Android apps in a matter of days."
Brian Pedone
Founder
Quiet Punch
Quiet Punch
"It took a couple of hours to incorporate their easy to use SDK. Nami provides a monetization machine learning solution, a paywall displaying what a user can purchase, and a whole suite of other useful features. As a result, it saved me development cycles so I could focus on other important things."
Mark Lapasa
Android Developer
Toronto App Factory
Toronto App Factory
"After spending a few days trying to implement subscriptions, I found Nami ML. I was able to complete in-app subscriptions within less than 3 hours."
Tanin Rojanapiansatith
iOS Developer
Transcrybr
Transcrybr

The best subscription experience starts with Nami

Get connected with one of our product experts to get started with your journey with Nami today.