PhoneGap purchase plugin cc.fovea.cordova.purchase is the best purchase plugin as I know, which supports iOS and Android google play.
To use it for auto-renewable subscription, you have to provide receipt verification. This code provides an easy way to setup your own service in nodejs.
-
You can deploy it to any nodejs platform, such as you can deploy it openshift, which is supported by our code without any change. If you don't know how to use openshift, see here: https://developers.openshift.com/en/node-js-getting-started.html
-
After deploy, you can change your code like below. You can see more sample code from here:https://github.com/Fovea/cordova-plugin-purchase-demo
// Strong suggest to keep your password on server side!!!
var password = 'Your app shared secrect from iTunes Connect'
var productId = 'your product id';
var productAlias = 'your product alias';
// Enable remote receipt validation, by default we validate on production environment, retry sandbox if fail
// isAutoRenew=true means this is auto renew, false means non auto renew
var queryString = '?password=' + password + '&isAutoRenew=true';
store.validator = "http://{Your host here}/verify" + queryString;
- support Android google play
- support Amazon app store
- how to sync openshift and github code
- Opening this URL launches iTunes or iTunes Store, and then displays the Manage Subscription page, https://buy.itunes.apple.com/WebObjects/MZFinance.woa/wa/manageSubscriptions