Skip to content

cozycodegh/cordova-plugin-inapppurchases_TESTAPP

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Cordova-Plugin-InAppPurchases Testing App

This a full app to test in-app purchases and subscriptions with Cordova and cordova-plugin-inapppurchases by cozycode.ca.

How to test in-app purchases with cordova:

  1. Have your app identifier string (eg. io.cordova.hellocordova)
    Log into App Store Connect and Google Play to create your apps, make a "bundle identifier" (aka widget id, or app identifier)
  2. Have your product ids,
    See testing tips to create in-app products and subscriptions
  3. Create a cordova project to test in:
cordova create new_test_dir app.bundle.identifier.to.test
  1. Add the in-app purchases plugin by codecodegh:
cd new_test_dir
cordova plugin add cordova-plugin-inapppurchases
cd ..
  1. Download this repository:
git clone https://github.com/cozycodegh/cordova-plugin-inapppurchases_TESTAPP
  1. Move the files into the cordova project test directory:
cp -r cordova-plugin-inapppurchases_TESTAPP/* new_test_dir/
  1. Edit the www/js/index.js file to include your product ids:
var product_id_1 = "ca.cozycode.non_consumable_product";
var product_id_2 = "";
var product_id_3 = "";
  • For Android, also create a www/manifest.json file with the base64 billing key in this test project:
{ "play_store_key": "<Base64-encoded public key from the Google Play Store>" }
  1. Run the test app on different platforms:
cordova platform add ios
cordova build ios
open platforms/ios/APPNAME.xcworkspace/
cordova platform add android
cordova run --device android

Test App Preview:

Android and iOS: