I’m using Cordova, in app purchases work perfectly on iOS, however on Android i keep getting the following error when i try to make a purchase:
Cannot read properties of undefined (reading 'INAPP')
Obviously this is referring to Purchases.PURCHASE_TYPE.INAPP in the code below, but i cannot figure out a solution to this after a ton of googling and whatnot, can someone give me some suggestions/pointers please?
1async function triggerPurchase(productId) {23if (device == "ios") {4const { customerInfo, productIdentifier } =5await Purchases.purchaseProduct(productId);67else if (device == "android") {89await Purchases.purchaseProduct(10productId,11({ productIdentifier, customerInfo }) => {},12({ error, userCancelled }) => {1314},15null,16Purchases.PURCHASE_TYPE.INAPP17);1819}