Question

RevenueCat returns empty customer info

  • 13 July 2022
  • 3 replies
  • 271 views

Badge +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

Userlevel 1
Badge +5

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.

Userlevel 1
Badge +5

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?

Badge +4

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

Reply