Skip to main content

The Firebase iOS documentation shows the following:

 

If you're using StoreKit 2, use the following code to log IAP events.

func purchaseSomeProduct(_ product: Product) {
// Purchase a Product. This is mostly standard boilerplate StoreKit 2
// code, except for the Analytics.logTransaction() call.
let result = try await product.purchase()
switch result {
case .success(let verification):
let transaction = try checkVerified(verification)

// Call this Firebase API to log the in-app purchase event.
Analytics.logTransaction(transaction)

await transaction.finish()
...
}

Given that RevenueCat does a fantastic job of abstracting away the complexity of StoreKit, is it still possible to call `Analytics.logTransaction(...)` after a purchase but before `transaction.finish()`?

 

Hi @RevCatUser123,

Apologies for closing the post before replying. RevenueCat doesn’t expose the verification object that Firebase needs, so that isn’t possible to do in RevenueCat. But if you listen to purchase events via StoreKit, then you’ll know when a purchase happens and you can go that route.

But, you may simply want to use RevenueCat’s Firebase integration instead of tracking purchases manually with Firebase.