Repository navigation
Carry product, transaction and paywall info on delegate events - #9
Merged
Merged
Conversation
ianrumac
force-pushed
the
fix/event-info-product-transaction
branch
from
September 9, 2026 10:19
f22f901 to
291bbf7
Compare
`handleSuperwallEvent` forwarded only `eventType` and the flattened analytics `params`. The associated values of the event - the `StoreProduct`, the `StoreTransaction`, the `PaywallInfo`, the failure error, the restore type - were dropped on both platforms, so `SuperwallEventInfo.Product`, `.Transaction`, `.PaywallInfo`, `.Error` and `.RestoreType` were always null. In particular the store transaction id was unreachable from Unity: a consumer that wanted to report a completed purchase to its own analytics had nothing to key it on. Both bridges now serialize those values for the paywall and transaction event families, with one wire shape: `product` in the existing `serializeStoreProduct` form, `transaction` mirroring the C# `StoreTransaction` model with ISO 8601 dates, `paywallInfo` via the existing serializer, `error` as the localized message and `restoreType` as `viaPurchase` / `viaRestore`. The C# side reads them; `Superwall.DeserializeStoreProduct` becomes `internal` so the callback handler can reuse it. On Android the transaction events carry the `StoreProductType` interface, so the full product serializer is used when the concrete `StoreProduct` is behind it and falls back to the identifier otherwise. `nonRecurringProductPurchase` carries a `TransactionProduct` on both platforms and is serialized as its id. Checked against SuperwallKit 4.16.3 and superwall-android 2.7.23. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
ianrumac
force-pushed
the
fix/event-info-product-transaction
branch
from
September 9, 2026 10:22
291bbf7 to
430d845
Compare
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.
Problem
handleSuperwallEventforwarded onlyeventTypeand the flattened analyticsparams. The associated valuesof the event (the
StoreProduct, theStoreTransaction, thePaywallInfo, the failure error, the restoretype) were dropped on both platforms, so
SuperwallEventInfo.Product,.Transaction,.PaywallInfo,.Errorand.RestoreTypewere always null. In particular the store transaction id was unreachable fromUnity: a consumer that wanted to report a completed purchase to its own analytics had nothing to key it on.
Fix
Both bridges serialize those values for the paywall and transaction event families, with one wire shape:
productin the existingserializeStoreProductformtransactionmirroring the C#StoreTransactionmodel with ISO 8601 datespaywallInfovia the existing serializererroras the localized message,restoreTypeasviaPurchase/viaRestoreThe C# side reads them;
Superwall.DeserializeStoreProductbecomesinternalso the callback handler canreuse it. On Android the transaction events carry the
StoreProductTypeinterface, so the full productserializer is used when the concrete
StoreProductis behind it and falls back to the identifier otherwise.nonRecurringProductPurchasecarries aTransactionProducton both platforms and is serialized as its id.Verification
On device:
TransactionCompletearrives withTransaction.StoreTransactionId= the Play order id(
GPA.3366-…) on Android and the App Store transaction id (2000001231794318) on iOS, andProduct.ProductIdentifier= the SKU.Checked against SuperwallKit 4.16.3 and superwall-android 2.7.23.
🤖 Generated with Claude Code
https://claude.ai/code/session_01LTHPGB4qyAwDVYmQHW87ex