Skip to content

Carry product, transaction and paywall info on delegate events - #9

Merged
ianrumac merged 1 commit into
superwall:mainfrom
bilck:fix/event-info-product-transaction
Sep 9, 2026
Merged

ianrumac merged 1 commit into
superwall:mainfrom
bilck:fix/event-info-product-transaction

Conversation

@bilck

@bilck bilck commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Problem

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.

Fix

Both bridges 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, 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.

Verification

On device: TransactionComplete arrives with Transaction.StoreTransactionId = the Play order id
(GPA.3366-…) on Android and the App Store transaction id (2000001231794318) on iOS, and
Product.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

@ianrumac
ianrumac force-pushed the fix/event-info-product-transaction branch from f22f901 to 291bbf7 Compare September 9, 2026 10:19
`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
ianrumac force-pushed the fix/event-info-product-transaction branch from 291bbf7 to 430d845 Compare September 9, 2026 10:22
@ianrumac
ianrumac merged commit 226d42c into superwall:main Sep 9, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants