Can't display price through RevenueCat by using Ionic capacitor

Viewed 66

I am trying to use RevenueCat to do In App Purchases with my Ionic React app by using typescript and capacitor. I have this following code in my Ionic app:

  const purchases = async () => {
        try {
            const offerings = await Purchases.getOfferings();
            if (offerings.current !== null && offerings.current.availablePackages.length !== 0) {
                console.log("OFFERING");
                console.log(offerings.current.monthly);
            }
        } catch (e) {
            console.log(e);
        }
    };

...

return (
     <IonButton onClick={purchases}>Monthly Subscription</IonButton>
)

I have got this error: cordova_not_available

I have read of this and knowing that React apps must use Capacitor to build native mobile apps. However, Ionic Native (and therefore, Cordova plugins) can still be used. So I did all the install plugin/packages in the article, however, it's still not working

0 Answers
Related