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: