-
-
Notifications
You must be signed in to change notification settings - Fork 535
Setup for Android Google Play
THIS DOCUMENTATION IS DEPRECATED. Please use https://purchase.fovea.cc
for more up-to-date information.
- Create an Application
- Add the Billing (License) Key
- Create Products
- Wait 6-8 hours
- Test
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.
cordova plugin add cordova-plugin-purchase
- 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".
- Install the signed app on your test device in release mode.
- Read carefully the Google testing guide to learn how to test your app: https://developer.android.com/google/play/billing/billing_testing.html
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.
- 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.