15
votes

I have been struggling with the implementation of in-app purchase for both iOS and Andriod in ionic. I came across tutorials regarding both the cordova-plugin-purchase and the ng-storekit, but seems like the tutorials were based on the version 3.4.1 of cordova-plugin-purchase, and the latest version now has undergone huge modification that the code is no longer applicable. I tried following the demo and API guide on Cordova-plugin-purchase, but no luck. Even window.store or window.storekit returns false.

Has anyone work with the latest version of Cordova-plugin-purchase in Ionic and successfully implement IAP? Any working examples demonstrating the initialisation and the purchase flow? Thank you very much.

2

2 Answers

11
votes

Maybe this brand new plugin (iOS/Android supported) could help you:

https://github.com/AlexDisler/cordova-plugin-inapppurchase

The author has written a recent post on his blog:

Add In App Purchases To Your Ionic Cordova App - Step By Step Guide With An Example App

and there is also a complete Ionic demo app on his Github repo:

https://github.com/AlexDisler/cordova-inapppurchases-app

1
votes

If you only need iOS support, Fovea's purchase plugin maintained backward compatibility with its legacy API. If neither window.store nor window.storekit is defined, then you probably didn't install it properly.

The new API is very well documented, supported and provides a demo app here if you wan't try it easily: https://github.com/Fovea/cordova-plugin-purchase-demo