bryantvu / Cordova-IAP-Plugin

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cordova-IAP-Plugin

HMS In-App Payment plugin for Cordova Android

Link to full Cordova project: https://github.com/bryantvu/Cordova-HMS-IAP-Demo

How to use

Create Cordova Project

Initialize project: https://cordova.apache.org/docs/en/latest/guide/cli/

cordova create hello com.bvutest.iapdemo HelloWorld

Navigate into project folder

cd hello

Add Android platform

cordova platform add android

Install Plugin

Download and extract files

Navigate to root folder and open shell

cordova plugin add /path/to/plugin/IapWrapper

Copy Files

Copy 'android-debug-keys.properties' and 'debug.p12' from plugin root folder to /platforms in project

Insert Demo Function

Add function to www/js/index.js and call from 'onDeviceReady: function()'

cordova.plugins.IapWrapper.getNonConsumables(
                success =>{
                    alert("success >> " + success);
                }, error => {
                    alert("fail >> " + error);
                });

Run Demo

cordova run android

About


Languages

Language:Java 53.1%Language:JavaScript 46.9%