Skip to content

Instantly share code, notes, and snippets.

@Samox
Created July 30, 2025 16:24
Show Gist options
  • Select an option

  • Save Samox/f3c55bd19134e7fac88d962b9ae8e10a to your computer and use it in GitHub Desktop.

Select an option

Save Samox/f3c55bd19134e7fac88d962b9ae8e10a to your computer and use it in GitHub Desktop.

Revisions

  1. Samox created this gist Jul 30, 2025.
    33 changes: 33 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,33 @@
    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;
    }
    }
    }