feat(analytics): add logTransaction method#967
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a new logTransaction API to the Analytics plugin to support logging StoreKit 2 transactions on iOS 15+ via Analytics.logTransaction, with Android/web explicitly returning unimplemented.
Changes:
- Add
logTransaction(options: { transactionId: string })to the public TS plugin interface and documentation. - Implement iOS native lookup of a
StoreKit.Transactionby transaction ID and forward it to Firebase Analytics. - Add
unimplementedstubs for Android and web.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/analytics/src/web.ts | Adds logTransaction stub that throws unimplemented on web. |
| packages/analytics/src/definitions.ts | Extends plugin interface + adds LogTransactionOptions. |
| packages/analytics/ios/Plugin/FirebaseAnalyticsPlugin.swift | Bridges new logTransaction method from JS to native implementation. |
| packages/analytics/ios/Plugin/FirebaseAnalyticsHelper.swift | Adds helper to extract Transaction from VerificationResult. |
| packages/analytics/ios/Plugin/FirebaseAnalytics.swift | Implements logTransaction via StoreKit 2 transaction lookup + Analytics.logTransaction. |
| packages/analytics/android/.../FirebaseAnalyticsPlugin.java | Adds logTransaction stub returning unimplemented on Android. |
| packages/analytics/README.md | Documents the new logTransaction API and options. |
| .changeset/add-log-transaction.md | Declares a minor release for @capacitor-firebase/analytics. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
@capacitor-firebase/analytics
@capacitor-firebase/app
@capacitor-firebase/app-check
@capacitor-firebase/authentication
@capacitor-firebase/crashlytics
@capacitor-firebase/firestore
@capacitor-firebase/functions
@capacitor-firebase/messaging
@capacitor-firebase/performance
@capacitor-firebase/remote-config
@capacitor-firebase/storage
commit: |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
logTransactionmethod to the Analytics plugin for logging StoreKit 2 transactions on iOS (15.0+)transactionIdstring, looks up the nativeStoreKit.Transaction, and callsAnalytics.logTransaction()unimplemented(Android auto-tracks IAP, web has no equivalent)Close #629