Android
Setup in-app purchases for Android
We are using RevenueCat to handle in-app purchases.
- Relevant Links: RevenueCat Docs
First, you need a Google Play Developer Account to setup in-app purchases.
Setup
Firstly, you need to see like that screen in RevenueCat.
Please click the link down below:
- Link: Google Cloud API Console
Create a new project or select an existing project.
Go to the Google Play Android Developer API page and Google Play Developer Reporting API page
Please click the Enable
button both of them.
After clicking the Enable
button, go home page in Google Cloud Console.
Go to IAM & Admin > Service Accounts Page
- Click the
Create Service Account
button. - Add your Service Account Name like:
SMF RC Service Account
. - Pick your first role : ‘Pub/Sub Admin’
- Other role should be ‘Monitoring Viewer’
- Click the
Continue
andDone
button.
After clicking the Done
button, you will see the screen like below.
- Click the
3 dots
button. - Click the
Manage Keys
button.
Click the Add Key
button. Then click the Create new key
button.
Please pick the JSON
and click the Create
button.
Save the JSON file and keep it in a safe place. We’ll use it in the next step.
By the way: Go to Pub/Sub Developer Notifications
- Go to the
Google Play Console
section. - Click
Users and Permissions
Go back to Google Cloud Console and Copy the service account mail.
Paste it in here and scroll down a little bit.
Click the Account Permissions
button.
Grant the following permissions:
- View app information and download bulk reports (read-only)
- View financial data, orders, and cancellation survey response
- Manage orders and subscriptions
Turn back to the RevenueCat dashboard and drop a json file in here.
- Write your app package name in here.
Pick a Google Developer Notification Topic ID.
- Click the
Connect to Google
button.
Then you will see like this screen. Copy the Google Developer Notification Topic ID.
Go to the Play Console.
Click the Create App
button if you don’t have any app.
Fill the form
Go to the Monetization
section.
- Paste your Developer Notification Topic ID in here.
- Pick notification content.
Copy the RevenueCat Public Key and paste it in .env
file.
That’s it! You have successfully completed the setup for Android.