From a26fcdfd49d51059ade4619145c571b9f60d5a57 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Wed, 17 Dec 2025 19:29:28 +0000 Subject: [PATCH 1/2] Update SDK version to 4.11.2 Co-authored-by: duncan --- content/docs/ios/index.mdx | 2 +- content/docs/ios/sdk-reference/index.mdx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/content/docs/ios/index.mdx b/content/docs/ios/index.mdx index 1d0d492..8146a2f 100644 --- a/content/docs/ios/index.mdx +++ b/content/docs/ios/index.mdx @@ -37,4 +37,4 @@ If you have feedback on any of our docs, please leave a rating and message at th If you have any issues with the SDK, please [open an issue on GitHub](https://github.com/superwall/superwall-ios/issues). - \ No newline at end of file + \ No newline at end of file diff --git a/content/docs/ios/sdk-reference/index.mdx b/content/docs/ios/sdk-reference/index.mdx index 4b35d6f..61f5e72 100644 --- a/content/docs/ios/sdk-reference/index.mdx +++ b/content/docs/ios/sdk-reference/index.mdx @@ -15,4 +15,4 @@ If you have feedback on any of our docs, please leave a rating and message at th If you have any issues with the SDK, please [open an issue on GitHub](https://github.com/superwall/superwall-ios/issues). - \ No newline at end of file + \ No newline at end of file From f0b5c29b807968afd2137aca6dd382642876e437 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Wed, 17 Dec 2025 21:10:51 +0000 Subject: [PATCH 2/2] feat: Add refreshConfiguration and transaction docs Co-authored-by: duncan --- content/docs/ios/meta.json | 3 + .../NonSubscriptionTransaction.mdx | 47 +++++++++++++++ .../sdk-reference/SubscriptionTransaction.mdx | 60 +++++++++++++++++++ content/docs/ios/sdk-reference/Superwall.mdx | 6 ++ .../docs/ios/sdk-reference/customerInfo.mdx | 4 ++ .../ios/sdk-reference/getDeviceAttributes.mdx | 12 ++-- .../sdk-reference/refreshConfiguration.mdx | 48 +++++++++++++++ 7 files changed, 175 insertions(+), 5 deletions(-) create mode 100644 content/docs/ios/sdk-reference/NonSubscriptionTransaction.mdx create mode 100644 content/docs/ios/sdk-reference/SubscriptionTransaction.mdx create mode 100644 content/docs/ios/sdk-reference/refreshConfiguration.mdx diff --git a/content/docs/ios/meta.json b/content/docs/ios/meta.json index fec8940..dffb346 100644 --- a/content/docs/ios/meta.json +++ b/content/docs/ios/meta.json @@ -24,6 +24,7 @@ "---SDK Reference---", "sdk-reference/index", "sdk-reference/configure", + "sdk-reference/refreshConfiguration", "sdk-reference/Superwall", "sdk-reference/register", "sdk-reference/identify", @@ -32,6 +33,8 @@ "sdk-reference/subscriptionStatus", "sdk-reference/customerInfo", "sdk-reference/getCustomerInfo", + "sdk-reference/SubscriptionTransaction", + "sdk-reference/NonSubscriptionTransaction", "sdk-reference/integrationAttributes", "sdk-reference/setIntegrationAttributes", "sdk-reference/getDeviceAttributes", diff --git a/content/docs/ios/sdk-reference/NonSubscriptionTransaction.mdx b/content/docs/ios/sdk-reference/NonSubscriptionTransaction.mdx new file mode 100644 index 0000000..795ddb4 --- /dev/null +++ b/content/docs/ios/sdk-reference/NonSubscriptionTransaction.mdx @@ -0,0 +1,47 @@ +--- +title: "NonSubscriptionTransaction" +description: "Represents a non-subscription transaction (consumables and non-consumables)." +--- + + +Introduced in 4.10.0. The `store` property was added in 4.11.0. + + +## Purpose +Provides details about one-time purchases in [`CustomerInfo`](/ios/sdk-reference/customerInfo), including which store fulfilled the purchase. + +## Properties + + +| Property | Type | Description | +|----------|------|-------------| +| `transactionId` | `String` | Unique identifier for the transaction. | +| `productId` | `String` | Product identifier for the purchase. | +| `purchaseDate` | `Date` | When the charge occurred. | +| `isConsumable` | `Bool` | `true` for consumables, `false` for non-consumables. | +| `isRevoked` | `Bool` | `true` if the transaction has been revoked. | +| `store` | `ProductStore` | Store that fulfilled the purchase (4.11.0+). | + + +### Store values (4.11.0+) +`appStore`, `stripe`, `paddle`, `playStore`, `superwall`, `other`. + +## Usage + +Inspect non-subscription purchases: +```swift +let customerInfo = Superwall.shared.customerInfo + +for purchase in customerInfo.nonSubscriptions { + print("Product: \(purchase.productId)") + print("Store: \(purchase.store)") + print("Consumable: \(purchase.isConsumable)") + print("Revoked: \(purchase.isRevoked)") +} +``` + +## Related + +- [`CustomerInfo`](/ios/sdk-reference/customerInfo) - Source of transaction data +- [`SubscriptionTransaction`](/ios/sdk-reference/SubscriptionTransaction) - Subscription transactions +- [`getCustomerInfo()`](/ios/sdk-reference/getCustomerInfo) - Fetch customer info asynchronously diff --git a/content/docs/ios/sdk-reference/SubscriptionTransaction.mdx b/content/docs/ios/sdk-reference/SubscriptionTransaction.mdx new file mode 100644 index 0000000..d40af36 --- /dev/null +++ b/content/docs/ios/sdk-reference/SubscriptionTransaction.mdx @@ -0,0 +1,60 @@ +--- +title: "SubscriptionTransaction" +description: "Represents a subscription transaction in the customer's purchase history." +--- + + +Introduced in 4.10.0. `offerType`, `subscriptionGroupId`, and `store` were added in 4.11.0. + + +## Purpose +Provides details about a single subscription transaction returned from [`CustomerInfo`](/ios/sdk-reference/customerInfo). Use this to understand renewal status, applied offers, and the store that fulfilled the purchase. + +## Properties + + +| Property | Type | Description | +|----------|------|-------------| +| `transactionId` | `String` | Unique identifier for the transaction. | +| `productId` | `String` | The product identifier for the subscription. | +| `purchaseDate` | `Date` | When the App Store charged the account. | +| `willRenew` | `Bool` | Whether the subscription is set to auto-renew. | +| `isRevoked` | `Bool` | `true` if the transaction has been revoked. | +| `isInGracePeriod` | `Bool` | `true` if the subscription is in grace period. | +| `isInBillingRetryPeriod` | `Bool` | `true` if the subscription is in billing retry. | +| `isActive` | `Bool` | `true` when the subscription is currently active. | +| `expirationDate` | `Date?` | Expiration date, if applicable. | +| `offerType` | `LatestSubscription.OfferType?` | Offer applied to this transaction (4.11.0+). | +| `subscriptionGroupId` | `String?` | Subscription group identifier if available (4.11.0+). | +| `store` | `ProductStore` | Store that fulfilled the purchase (4.11.0+). | + + +### Offer types (4.11.0+) +- `trial` — introductory offer. +- `code` — offer redeemed with a promo code. +- `promotional` — StoreKit promotional offer. +- `winback` — win-back offer (iOS 17.2+ only). + +### Store values (4.11.0+) +`appStore`, `stripe`, `paddle`, `playStore`, `superwall`, `other`. + +## Usage + +Inspect subscription transactions: +```swift +let customerInfo = Superwall.shared.customerInfo + +for subscription in customerInfo.subscriptions { + print("Product: \(subscription.productId)") + print("Store: \(subscription.store)") + print("Offer: \(subscription.offerType?.rawValue ?? "none")") + print("Group: \(subscription.subscriptionGroupId ?? "unknown")") + print("Expires: \(String(describing: subscription.expirationDate))") +} +``` + +## Related + +- [`CustomerInfo`](/ios/sdk-reference/customerInfo) - Source of subscription data +- [`NonSubscriptionTransaction`](/ios/sdk-reference/NonSubscriptionTransaction) - Non-subscription transactions +- [`getCustomerInfo()`](/ios/sdk-reference/getCustomerInfo) - Fetch customer info asynchronously diff --git a/content/docs/ios/sdk-reference/Superwall.mdx b/content/docs/ios/sdk-reference/Superwall.mdx index 92fce48..b418785 100644 --- a/content/docs/ios/sdk-reference/Superwall.mdx +++ b/content/docs/ios/sdk-reference/Superwall.mdx @@ -94,4 +94,10 @@ Confirm all experiment assignments: // Get all experiment assignments let assignments = await Superwall.shared.confirmAllAssignments() print("Confirmed \(assignments.count) assignments") +``` + +Manually refresh configuration (development-only): +```swift +// Useful when hot-reloading paywalls during development +await Superwall.shared.refreshConfiguration() ``` \ No newline at end of file diff --git a/content/docs/ios/sdk-reference/customerInfo.mdx b/content/docs/ios/sdk-reference/customerInfo.mdx index 814db2c..d65dbde 100644 --- a/content/docs/ios/sdk-reference/customerInfo.mdx +++ b/content/docs/ios/sdk-reference/customerInfo.mdx @@ -32,6 +32,10 @@ public var customerInfo: CustomerInfo { get } | `userId` | `String` | The ID of the user. Equivalent to [`Superwall.userId`](/ios/sdk-reference/userId). | + +Starting in 4.11.0, transactions include offer metadata (`offerType`), the `subscriptionGroupId`, and the `store` (`ProductStore`) that fulfilled the purchase to help you audit cross-store sales. + + ## Returns / State Returns a `CustomerInfo` object containing the latest customer purchase and subscription data. This object is immutable and does not update automatically—you must access the property again to get the latest data. diff --git a/content/docs/ios/sdk-reference/getDeviceAttributes.mdx b/content/docs/ios/sdk-reference/getDeviceAttributes.mdx index dad61e3..5d5cbac 100644 --- a/content/docs/ios/sdk-reference/getDeviceAttributes.mdx +++ b/content/docs/ios/sdk-reference/getDeviceAttributes.mdx @@ -7,6 +7,10 @@ description: "Gets properties stored about the device that are used in audience This method returns all device attributes that can be used in audience filters in the Superwall dashboard. + +`isApplePayAvailable` is deprecated starting in 4.11.2 and now always returns `true`. It will be removed in a future release and should no longer be used in audience filters. + + ## Purpose Retrieves a dictionary of device properties that are used when evaluating audience filters. This is useful for debugging audience filter behavior or understanding what device attributes are available. @@ -20,7 +24,7 @@ No parameters. ## Returns / State Returns a dictionary mapping attribute names to their values. Common attributes include: -- `isApplePayAvailable` - Whether Apple Pay is available and the user has added a card (available in version 4.9.0+) +- `isApplePayAvailable` - Deprecated in 4.11.2 and always `true` (previously indicated Apple Pay availability) - `swiftVersion` - The Swift version (available in version 4.7.0+) - `compilerVersion` - The compiler version (available in version 4.7.0+) - `localeIdentifier` - The device locale @@ -35,9 +39,7 @@ Get device attributes: let deviceAttributes = await Superwall.shared.getDeviceAttributes() // Check specific attributes -if let isApplePayAvailable = deviceAttributes["isApplePayAvailable"] as? Bool { - print("Apple Pay available: \(isApplePayAvailable)") -} +// `isApplePayAvailable` is deprecated and always true in 4.11.2+ // Print all attributes for debugging print("Device attributes: \(deviceAttributes)") @@ -58,5 +60,5 @@ Task { ## Related - Device attributes are automatically used in audience filters -- `isApplePayAvailable` was added in version 4.9.0 and updated in 4.10.5 for more accurate filtering +- `isApplePayAvailable` was added in 4.9.0, updated in 4.10.5, and deprecated in 4.11.2 (now always `true`) - `swiftVersion` and `compilerVersion` were added in version 4.7.0 diff --git a/content/docs/ios/sdk-reference/refreshConfiguration.mdx b/content/docs/ios/sdk-reference/refreshConfiguration.mdx new file mode 100644 index 0000000..ec976ce --- /dev/null +++ b/content/docs/ios/sdk-reference/refreshConfiguration.mdx @@ -0,0 +1,48 @@ +--- +title: "refreshConfiguration" +description: "Manually refreshes the Superwall configuration. Intended for development and wrapper SDKs." +--- + + +This method is intended for development workflows (for example, wrapper SDK hot reloading) and should not be called during normal app runtime. It triggers extra network requests and re-caches paywalls. + + +## Purpose +Fetches the latest configuration from the Superwall dashboard and refreshes cached paywalls. Useful when iterating on paywalls during development without restarting the app. + +## Signatures +```swift +public func refreshConfiguration() async +public func refreshConfiguration(completion: (() -> Void)? = nil) +``` + +## Parameters +- `completion` (optional): Called after the refresh finishes when using the completion-based API. + +## Returns / State +- Refreshes configuration and reloads any paywalls that have changed or been removed. +- Does not return a value. +- Development-only; avoid calling in production code paths. + +## Usage + +Refresh configuration after editing paywalls in development: +```swift +Task { + await Superwall.shared.refreshConfiguration() + // Updated paywalls will be used on the next presentation +} +``` + +Objective-C or completion-based refresh: +```swift +Superwall.shared.refreshConfiguration { + // Handle post-refresh work here +} +``` + +## Related + +- [`configure()`](/ios/sdk-reference/configure) - Initial configuration of the SDK +- [`PaywallOptions/shouldPreload`](/ios/sdk-reference/PaywallOptions#properties) - Controls whether paywalls are preloaded +- [`preloadAllPaywalls()`](/ios/sdk-reference/Superwall#usage) - Preload paywalls manually