Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrating Firebase Analytics.logTransaction function #4512

Closed
jaydipbvi opened this issue Nov 22, 2024 · 2 comments
Closed

Integrating Firebase Analytics.logTransaction function #4512

jaydipbvi opened this issue Nov 22, 2024 · 2 comments
Labels

Comments

@jaydipbvi
Copy link

How to add Firebase Analytic.logTransaction while we are using revenueCat

Here is code provide by Firebase

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()
  ...
} 

But the issue is we get StoreTrasaction while purchase and Firebase require FIRTrancation

in this case above code not working

In this link%20%7B%20%2F%2F%20Purchase%20a%20Product.) some one mention it not support with revenueCat

is it true? if not than how can handle this?

@jaydipbvi jaydipbvi added the bug label Nov 22, 2024
@RCGitBot
Copy link
Contributor

👀 We've just linked this issue to our internal tracker and notified the team. Thank you for reporting, we're checking this out!

@HaleyRevcat
Copy link

Hi, unfortunately at this time Analytic.logTransaction is not possible when using RevenueCat. RevenueCat does not get the FIRTrancation value, and RevenueCat finishes transactions as soon as they’re made, so that by the time you get a result from purchaseProduct, the transaction is finished. As such even calling Analytics.logTransaction(...) after a purchase but before transaction.finish() is difficult to do. You can see another post on this issue here.

I recommend using our Firebase integration here instead, or you can try reaching out to Firebase about this to see if they have any recommendations.

@Jethro87 Jethro87 closed this as completed Dec 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants