In the world of app development, in-app subscriptions can be a game-changer for monetization. However, setting them up can be a daunting task. That's why we've created this comprehensive guide to help you navigate the process and get your app ready for subscription-based revenue.
Getting Started
Before diving into the technical aspects, it's essential to define what in-app products you want to offer to your users. Let's use an example of creating an app that charges a subscription to display random cat GIFs – because who doesn't love cats?
For this example, we'll create three subscription options:
- $0.99/month – Unlimited cat GIFs
- $2.99/year + trial – Unlimited cat GIFs with a 1-week trial period
- $5.99 – Unlimited access as a one-time purchase
Configuring Google Play Billing
To configure Google Play Billing, you'll need to access your app's Google Play Console. While we'll be using RevenueCat's Purchases in this guide, the configuration steps are similar whether you're using RevenueCat or not.
First, set up your payments profile in the Google Play Developer Console. Follow Google's guide for more information on setting up your payments profile.
Next, create an app in the Google Play Console (assuming you haven't done so already), open that app in the console, and access the in-app products section under the "Store presence" menu in the sidebar.
In this section, you'll find two tabs: "Managed Products" and "Subscriptions." "Managed Products" are one-time purchases, while "Subscriptions" are recurring. For our example, we have designed two subscription products (monthly and annual) and a single one-time product (unlimited lifetime access).
Creating Products
To create a new subscription product, press the "Create Subscription" button and fill out the details.
The product ID is used to uniquely identify this particular subscription product. Make sure to choose an ID that's easy to identify by you and contains details about the product. In our example, we'll be using the following product IDs:
- onemonth: $0.99
- annual: $2.99
Give your subscription a title and description. These will be the title and description your users see when purchasing.
Make sure to mark your subscription as "Active." Once created, you can't deactivate it afterwards.
Configuring RevenueCat
To manage your in-app subscriptions and purchases using RevenueCat, you'll need to set up service credentials.
In the Google Play Console, access the API access section under Developer Account and create a new project. If you already have a project, link your account to your existing project by pressing the Link button.
Create a Service Account associated with that project. Give it a name and description, then press Create. Grant Owner permissions to the service account and press Continue. Finally, create a JSON Key and store it in a safe place.
Back in the Google Play Console, press Done in the modal. The page will refresh, and you'll see a new service account. You can grant access now to that new Service Account by selecting Finance in the Role dropdown and pressing Add user.
Remember the JSON key you saved? RevenueCat needs it to communicate with Google and track your data. Let's add it in the RevenueCat panel.
If you don't have an account at RevenueCat, create one, log in, and add an app to your account. Name your app and jump into the "Android Configuration" section. Add the name of your Google Play Package (the package you configure in your AndroidManifest) and the contents of the JSON file you previously downloaded from Google.
Give your App a name and
That's it! With these steps, you should have successfully set up in-app subscriptions for your app using RevenueCat.