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 content/docs/ios/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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).

<SdkLatestVersion version="4.10.8" repoUrl="https://github.com/superwall/Superwall-iOS" />
<SdkLatestVersion version="4.11.2" repoUrl="https://github.com/superwall/Superwall-iOS" />
3 changes: 3 additions & 0 deletions content/docs/ios/meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"---SDK Reference---",
"sdk-reference/index",
"sdk-reference/configure",
"sdk-reference/refreshConfiguration",
"sdk-reference/Superwall",
"sdk-reference/register",
"sdk-reference/identify",
Expand All @@ -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",
Expand Down
47 changes: 47 additions & 0 deletions content/docs/ios/sdk-reference/NonSubscriptionTransaction.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
---
title: "NonSubscriptionTransaction"
description: "Represents a non-subscription transaction (consumables and non-consumables)."
---

<Info>
Introduced in 4.10.0. The `store` property was added in 4.11.0.
</Info>

## Purpose
Provides details about one-time purchases in [`CustomerInfo`](/ios/sdk-reference/customerInfo), including which store fulfilled the purchase.

## Properties

<ParamTable>
| 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+). |
</ParamTable>

### 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
60 changes: 60 additions & 0 deletions content/docs/ios/sdk-reference/SubscriptionTransaction.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
---
title: "SubscriptionTransaction"
description: "Represents a subscription transaction in the customer's purchase history."
---

<Info>
Introduced in 4.10.0. `offerType`, `subscriptionGroupId`, and `store` were added in 4.11.0.
</Info>

## 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

<ParamTable>
| 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+). |
</ParamTable>

### 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
6 changes: 6 additions & 0 deletions content/docs/ios/sdk-reference/Superwall.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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()
```
4 changes: 4 additions & 0 deletions content/docs/ios/sdk-reference/customerInfo.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ public var customerInfo: CustomerInfo { get }
| `userId` | `String` | The ID of the user. Equivalent to [`Superwall.userId`](/ios/sdk-reference/userId). |
</ParamTable>

<Note>
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.
</Note>

## 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.

Expand Down
12 changes: 7 additions & 5 deletions content/docs/ios/sdk-reference/getDeviceAttributes.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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.
</Info>

<Warning>
`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.
</Warning>

## 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.

Expand All @@ -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
Expand All @@ -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)")
Expand All @@ -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
2 changes: 1 addition & 1 deletion content/docs/ios/sdk-reference/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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).

<SdkLatestVersion version="4.10.8" repoUrl="https://github.com/superwall/Superwall-iOS" />
<SdkLatestVersion version="4.11.2" repoUrl="https://github.com/superwall/Superwall-iOS" />
48 changes: 48 additions & 0 deletions content/docs/ios/sdk-reference/refreshConfiguration.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
---
title: "refreshConfiguration"
description: "Manually refreshes the Superwall configuration. Intended for development and wrapper SDKs."
---

<Warning>
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.
</Warning>

## 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