Lost in the wilderness if anyone can help me, much appreciated. I tried to integrate import { InAppPurchase2, IAPProduct } from '@awesome-cordova-plugins/in-app-purchase-2';
based on In App Purchase 2 - Awesome Cordova Plugins
and this tutorial for Angular: How to use Ionic In App Purchase with Capacitor | Devdactic
npm install @awesome-cordova-plugins/in-app-purchase-2
npm i cordova-plugin-purchase
(I did not know which to use)
and
npm i cc.fovea.cordova.purchase
I get these errors–the plugins are not initializing?
[Warning] Native: tried calling InAppPurchase2.when, but the InAppPurchase2 plugin is not installed. (chunk-vendors.0a794c7c.js, line 16)
[Warning] Install the InAppPurchase2 plugin: 'ionic cordova plugin add cordova-plugin-purchase' (chunk-vendors.0a794c7c.js, line 16)
TypeError: Cs.g.when("product").approved is not a function. (In 'Cs.g.when("product").approved((e=>(e.id===Ds&&(Ts.value+=100),e.verify())))', 'Cs.g.when("product").approved' is undefined)
The execution path is:
import { InAppPurchase2 } from '@awesome-cordova-plugins/in-app-purchase-2';
// Register products
InAppPurchase2.register({
id: 'product_id',
type: InAppPurchase2.CONSUMABLE
});
// Handle the product deliverable after purchase
InAppPurchase2.when('your_product_id').approved(product => {
// Handle successful purchase here
product.finish();
});
Any help with what to do would be much appreciated. Should I be using GitHub - RevenueCat/purchases-capacitor: Capacitor in-app purchases and subscriptions made easy. instead?