Skip to main content
Question

RevenueCat returns empty customer info


Forum|alt.badge.img+4

I am having an issue with getting information from RevenueCat products and customer info. I have followed the guidelines step by step, but the delegate returns empty!

First, configuring the SDK:

@main
struct ProjectApp: App {


    init() {

        Purchases.logLevel = .debug
        Purchases.configure(
            with: Configuration.Builder(withAPIKey: "PUBLIC_API_KEY")
                .with(usesStoreKit2IfAvailable: true)
                .build()
        )
        Purchases.shared.delegate = PurchasesDelegateHandler.shared
    }
    .
    .
    .

and then handling delegates using PurchasesDelegateHandler just like the official's sample demo:

class PurchasesDelegateHandler: NSObject, ObservableObject {
    static let shared = PurchasesDelegateHandler()
}
extension PurchasesDelegateHandler: PurchasesDelegate {

    func purchases(_ purchases: Purchases, receivedUpdated customerInfo: CustomerInfo) {
        SubscriptionManager.shared.customerInfo = customerInfo
        print(purchases)
        print(customerInfo.entitlements.all)

    }
}

and here is the debug logs:

https://i.stack.imgur.com/xua7o.jpg

3 replies

NachoSoto
Forum|alt.badge.img+5
  • Active Helper
  • 22 replies
  • July 13, 2022

Thanks for the detailed bug report!

From the logs it appears that the delegate method is simply never called, can you confirm that?

I will try to reproduce this.


NachoSoto
Forum|alt.badge.img+5
  • Active Helper
  • 22 replies
  • July 13, 2022

I just ran your same code and it’s working for me:

 

Can you give us more details about your environment? Are you running on device? Which Xcode / iOS version?


Forum|alt.badge.img+4

Thank you so much for your response, The problem has been resolved now, there was an issue in creating offerings. 
 


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