Skip to content

Setup for Android Google Play

Jean-Christophe Hoelt edited this page Sep 4, 2023 · 3 revisions

Setup Android Applications

THIS DOCUMENTATION IS DEPRECATED. Please use https://purchase.fovea.cc for more up-to-date information.


Create Android Applications

Recently you can test IAP on PlayStore only if your app is already published. If you don't want to make it available before testing, you can publish it in alpha (recommended) or beta state instead of production.

  • Create a release APK of your app and sign it.
  • Create a new application in the Developer Console.
  • Upload your APK.
  • Enter the app description, logo, etc. then click on save.

Install the plugin

cordova plugin add cordova-plugin-purchase

Create New Products on Android

  • Add in-app purchases items from the Developer Console
  • Activate them
    • No need to publish the app.

Purchase types:

  • for consumable, non consumable and non-renewing subscriptions choose "managed".
  • for free and paid subscriptions, choose "subscriptions".

Test Android Applications

The Google Account on the test device should not be the same as the developer account.

You can test purchase with no charge by adding google test account in your developer console -> 'Settings -> gmail accounts with testing access".

It's easier to be done with an alpha published app. You add users to a google group then send a link and they sign up on their own.

To test locally, install the same same release signed app on a device which is logged into play store using a test account. If you use the debug build, you can do some actions, however you will not be able to buy the product.

Sometimes, publishing the app (for a short period) on Google Play proved to be the only way to make testing IAP work.

Debug an Android Release Build

  • Upload the build to Alpha/Beta channel of google play
  • Open the cordova project in Android Studio
  • Add the following to your application node in the android manifest : android:debuggable="true"
  • Build a new APK using Android Studio
  • Deploy to your usb device using ADB install command adb -d install /path/to/release.apk
  • It loaded the release app on the physical device and you are still able to inspect the app via chrome.