Skip to main content
Solved

Cordova error on capacitor: Purchases has not been configured


Tom McLellan
Forum|alt.badge.img+5

I’m upgrading an old project (Ionic with Capacitor 5) from cordova-plugin-purchases 2.3.2 to the latest 3.13.0. I’m calling configureWith using a valid API key and user id, and 10 seconds later, I call getOfferings() and get a fatal error in xcode:

PurchasesHybridCommon/CommonFunctionality.swift:21: Fatal error: Purchases has not been configured. Please configure the SDK before calling this method

UPDATE:

I should have read the configureWith docs more carefully - I was calling it in the same style as Purchases.configure(apiKey, appUserId). Changing it Purchases.configureWith({apiKey, appUserId}) solves the problem!  Leaving this here in case anyone else makes the same mistake. 🤦🙂

Best answer by Haley Pace

Hi,  yes you want to make sure you are calling configureWith. The only other thing that may cause this error is if the Purchases object is null.

View original
Did this post help you find an answer to your question?

3 replies

Forum|alt.badge.img+8
  • RevenueCat Staff
  • 514 replies
  • Answer
  • May 31, 2023

Hi,  yes you want to make sure you are calling configureWith. The only other thing that may cause this error is if the Purchases object is null.


Forum|alt.badge.img+7
  • Helper
  • 19 replies
  • June 11, 2023

Hi Guys,
I’m getting this error in Flutter/iOS app where I’ve added and modified the code form the video tutorial Magic Weather.

I can run Magic Weather with no issues. But in the app where I need the live in-app purchases and subscriptions, i get the same error.

I’m not using Cordova though.

 

Michael


Forum|alt.badge.img+5

Any solution?


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings