StoreKit 2 on iOS: What is the Flutter Equivalent of Analytics.logTransaction for Manually Logging in_app_purchase Events? #17904
Unanswered
ibrahimdevs
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi everyone,
I’m working on correctly logging
in_app_purchaseevents on iOS when using StoreKit 2, and I would like to clarify which FlutterFire API corresponds to the native Firebase Analytics call.Background
According to the Firebase documentation:
https://firebase.google.com/docs/analytics/measure-in-app-purchases#implementation-apple
When using StoreKit 2, the
in_app_purchaseevent is not automatically logged. Firebase provides the following native API for manually logging the purchase:This makes sense, because on StoreKit 2 the SDK no longer receives automatic transaction updates.
Question: What is the Flutter equivalent of
Analytics.logTransaction?I noticed this recent PR in FlutterFire:
#17851
It introduces a new method:
logInAppPurchase(...)However, the documentation comment included in the PR raises a bit of confusion:
This wording makes it sound similar to the manual logging method described in:
https://firebase.google.com/docs/analytics/webview?platform=ios#log_in-app_purchase_events_manually_in_a_webview_on_ios
—which is specifically designed for WebView or non-native billing flows.
Main Question
Is
logInAppPurchase()the Flutter equivalent ofAnalytics.logTransaction(transaction)for StoreKit 2 on iOS?In our case:
We handle all our in-app purchase flows using the adapty_flutter package:
https://pub.dev/packages/adapty_flutter
So purchases do run entirely through native StoreKit 2, not through WebView, external billing, or custom payment flows.
We just need to manually log the
in_app_purchaseevent because StoreKit 2 no longer sends it automatically.So what I need to confirm is:
👉 Should Flutter apps using StoreKit 2 manually log the event using
logInAppPurchase()?Is this the intended equivalent of:
Or is another API planned for this specific StoreKit 2 use case?
Thanks!
This clarification is important for correct subscription and purchase reporting on Firebase Analytics (and for downstream integrations like Google Ads), so any confirmation would be greatly appreciated.
@russellwheatley @Lyokone @SelaseKay @Ehesp
Beta Was this translation helpful? Give feedback.
All reactions