Skip to content

Instantly share code, notes, and snippets.

@Samox
Created July 30, 2025 16:24
Show Gist options
  • Save Samox/f3c55bd19134e7fac88d962b9ae8e10a to your computer and use it in GitHub Desktop.
Save Samox/f3c55bd19134e7fac88d962b9ae8e10a to your computer and use it in GitHub Desktop.
Track subscription in Adjust from Superwall events for iOS
export class MySuperwallDelegate extends SuperwallDelegate {
handleSuperwallEvent(eventInfo: SuperwallEventInfo) {
switch (eventInfo.event.type) {
case EventType.transactionComplete:
const product = eventInfo.event.product;
const transaction = eventInfo.event.transaction;
if (product && transaction) {
console.info("product", product);
console.info("transaction", transaction);
trackPlatformPurchase({
price: product.price,
currency: product.currencyCode!,
transactionId:
transaction.originalTransactionIdentifier || undefined,
sku: product.productIdentifier,
orderId: transaction.storeTransactionId || undefined,
signature: undefined,
purchaseToken: undefined,
});
const subscription = new AdjustAppStoreSubscription(
String(product.price),
product.currencyCode,
transaction.originalTransactionIdentifier,
);
Adjust.trackAppStoreSubscription(subscription);
}
break;
default:
break;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment