IAP in the Intel® XDK
Android In-App Billing lets you sell digital content in your application. This article explains how to use Android In-App Billing with Intel XDK. We will use a cordova plugin that Wizcorp has published in Github*
To install the plugin and test it, you need to do a few steps.
Add the payment plugin to your XDK project and build an APK.
2.Publish the APK in google play as an alpha release
3.Add products you want to sell in google play
4.Add the billing key to your project
5.Rebuild the APK and publish it
Step 1: Add the payment plugin to your XDK project and build an APK
Download the plugin from Github*. Copy the folder into your "www/plugins" directory inside your XDK project. To add the plugin, you must use the ‘import local plugin’ option described here. You cannot pull the plugin directly from a repo because you must edit a file to include your license key. Use ‘Wizard Puchase Plugin’ for name, jp.wizcorp.phonegap.plugin.wizPurchase for id, and import the phonegap-plugin-wizPurchase-develop directory.
Step 2: Publish the APK in google play as an alpha release
In the Google play dashboard, upload your APK in the Alpha testing tab. It is the same screen where you upload production APKs.
Step 3: Add products you want to sell in google play
See Google Play In-app Billing for directions.
Step 4: Add the billing key to your project
In google play console click "Services & API's" and locate your YOUR LICENSE KEY FOR THIS APPLICATION . You will need to modify a file in the Wizcorp plugin and enter the license key. In your project, go to www->plugins->phonegap-plugin-wizPurchase-develop->platforms->android->res->values and edit billing_key.xml . You will need to copy your key into the value for "billing_key". Without this, your app will NOT work.
Step 5: Rebuild APK and Publish it
Testing
You can find more instructions on testing at Testing In-app Billing