Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/badges/branches.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ The changelog for `Superwall`. Also see the [releases](https://github.com/superw

## Enhancements

- Always redeem existing web codes after a successful purchase and on restore.
- Adds `fontScale` and `fontSize` device attributes for the system text size.
- Memoizes the device template used for audience-filter evaluation and paywall templating. The template is now rebuilt only when one of its mutable inputs (identity, entitlements, subscription status, interface style, platform wrapper, etc.) changes, while time-derived fields are recomputed on every read. This removes a full JSON round trip and repeated system lookups from every `register()` call.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -592,6 +592,9 @@ class DependencyContainer(
showRestoreDialogForWeb = {
showWebRestoreSuccesful()
},
notifyBackendOfReceipts = {
reedemer.redeem(WebPaywallRedeemer.RedeemType.Existing)
},
entitlementsById = {
entitlements.byProductId(it)
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ class TransactionManager(
Superwall.instance.entitlements.web
},
private val showRestoreDialogForWeb: suspend () -> Unit,
private val notifyBackendOfReceipts: suspend () -> Unit = {},
private val refreshReceipt: () -> Unit,
private val updateState: (cacheKey: String, update: PaywallViewState.Updates) -> Unit,
private val notifyOfTransactionComplete: suspend (paywallCacheKey: String, trialEndDate: Long?, productId: String) -> Unit,
Expand Down Expand Up @@ -478,6 +479,8 @@ class TransactionManager(
PaywallResult.Restored(),
)
}

ioScope.launchWithTracking { notifyBackendOfReceipts() }
}

private fun trackFailure(
Expand Down Expand Up @@ -657,6 +660,8 @@ class TransactionManager(

storeManager.loadPurchasedProducts(allEntitlementsByProductId())

ioScope.launchWithTracking { notifyBackendOfReceipts() }

trackTransactionDidSucceed(transaction, product, purchaseSource, didStartFreeTrial)

if (shouldDismiss && factory.makeSuperwallOptions().paywalls.automaticallyDismiss) {
Expand Down Expand Up @@ -695,6 +700,8 @@ class TransactionManager(
}
storeManager.loadPurchasedProducts(allEntitlementsByProductId())

ioScope.launchWithTracking { notifyBackendOfReceipts() }

trackTransactionDidSucceed(transaction, product, purchaseSource, didStartFreeTrial)
}
}
Expand Down
Loading