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
7 changes: 7 additions & 0 deletions content/docs/flutter/changelog.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ description: "Release notes for the Superwall Flutter SDK"
---


## 2.4.7

### Enhancements

- Updates iOS SDK to 4.12.7 [View iOS SDK release notes](https://github.com/superwall/Superwall-iOS/releases/tag/4.12.7).
- Updates Android SDK to 2.6.8 [View Android SDK release notes](https://github.com/superwall/Superwall-Android/releases/tag/2.6.8).

## 2.4.6

## Enhancements
Expand Down
2 changes: 1 addition & 1 deletion content/docs/flutter/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,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-flutter/issues).

<SdkLatestVersion version="2.4.6" repoUrl="https://github.com/superwall/Superwall-Flutter" />
<SdkLatestVersion version="2.4.7" repoUrl="https://github.com/superwall/Superwall-Flutter" />
2 changes: 2 additions & 0 deletions content/docs/flutter/meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@
"sdk-reference/PurchaseController",
"sdk-reference/PresentationResult",
"sdk-reference/CustomerInfo",
"sdk-reference/SubscriptionTransaction",
"sdk-reference/NonSubscriptionTransaction",
"sdk-reference/Entitlements",
"sdk-reference/IntegrationAttribute",
"sdk-reference/handleDeepLink",
Expand Down
70 changes: 70 additions & 0 deletions content/docs/flutter/sdk-reference/NonSubscriptionTransaction.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
---
title: "NonSubscriptionTransaction"
description: "Represents a non-subscription transaction (consumables and non-consumables)."
---

<Info>
The `store` field was added in 2.4.7.
</Info>

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

## Properties

<TypeTable
type={{
transactionId: {
type: "String",
description: "Unique identifier for the transaction.",
required: true,
},
productId: {
type: "String",
description: "Product identifier for the purchase.",
required: true,
},
purchaseDate: {
type: "DateTime",
description: "When the charge occurred.",
required: true,
},
isConsumable: {
type: "bool",
description: "`true` for consumables, `false` for non-consumables.",
required: true,
},
isRevoked: {
type: "bool",
description: "`true` if the transaction has been revoked.",
required: true,
},
store: {
type: "ProductStore?",
description: "Store that fulfilled the purchase (2.4.7+).",
},
}}
/>

## Store values (2.4.7+)
`appStore`, `stripe`, `paddle`, `playStore`, `superwall`, `other`.

## Usage

Inspect non-subscription purchases:
```dart
final customerInfo = await Superwall.shared.getCustomerInfo();

for (final purchase in customerInfo.nonSubscriptions) {
print('Product: ${purchase.productId}');
print('Store: ${purchase.store}');
print('Consumable: ${purchase.isConsumable}');
print('Revoked: ${purchase.isRevoked}');
}
```

## Related

- [`CustomerInfo`](/flutter/sdk-reference/CustomerInfo) - Source of transaction data
- [`SubscriptionTransaction`](/flutter/sdk-reference/SubscriptionTransaction) - Subscription transactions
- [`getCustomerInfo()`](/flutter/sdk-reference/getCustomerInfo) - Fetch customer info
104 changes: 104 additions & 0 deletions content/docs/flutter/sdk-reference/SubscriptionTransaction.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
---
title: "SubscriptionTransaction"
description: "Represents a subscription transaction in the customer's purchase history."
---

<Info>
The `offerType`, `subscriptionGroupId`, and `store` fields were added in 2.4.7.
</Info>

## Purpose
Provides details about a single subscription transaction returned from [`CustomerInfo`](/flutter/sdk-reference/CustomerInfo). Use this to understand renewal status, applied offers, and the store that fulfilled the purchase.

## Properties

<TypeTable
type={{
transactionId: {
type: "String",
description: "Unique identifier for the transaction.",
required: true,
},
productId: {
type: "String",
description: "Product identifier for the subscription.",
required: true,
},
purchaseDate: {
type: "DateTime",
description: "When the store charged the account.",
required: true,
},
willRenew: {
type: "bool",
description: "Whether the subscription is set to auto-renew.",
required: true,
},
isRevoked: {
type: "bool",
description: "`true` if the transaction has been revoked.",
required: true,
},
isInGracePeriod: {
type: "bool",
description: "`true` if the subscription is in grace period.",
required: true,
},
isInBillingRetryPeriod: {
type: "bool",
description: "`true` if the subscription is in billing retry.",
required: true,
},
isActive: {
type: "bool",
description: "`true` when the subscription is currently active.",
required: true,
},
expirationDate: {
type: "DateTime?",
description: "Expiration date, if applicable.",
},
offerType: {
type: "LatestSubscriptionOfferType?",
description: "Offer applied to this transaction (2.4.7+).",
},
subscriptionGroupId: {
type: "String?",
description: "Subscription group identifier, if available (2.4.7+).",
},
store: {
type: "ProductStore?",
description: "Store that fulfilled the purchase (2.4.7+).",
},
}}
/>

## Offer types (2.4.7+)
- `trial` - introductory offer.
- `code` - offer redeemed with a promo code.
- `promotional` - promotional offer.
- `winback` - win-back offer (iOS 17.2+ only).

## Store values (2.4.7+)
`appStore`, `stripe`, `paddle`, `playStore`, `superwall`, `other`.

## Usage

Inspect subscription transactions:
```dart
final customerInfo = await Superwall.shared.getCustomerInfo();

for (final subscription in customerInfo.subscriptions) {
print('Product: ${subscription.productId}');
print('Active: ${subscription.isActive}');
print('Store: ${subscription.store}');
print('Offer: ${subscription.offerType}');
print('Group: ${subscription.subscriptionGroupId ?? "unknown"}');
}
```

## Related

- [`CustomerInfo`](/flutter/sdk-reference/CustomerInfo) - Source of subscription data
- [`NonSubscriptionTransaction`](/flutter/sdk-reference/NonSubscriptionTransaction) - Non-subscription transactions
- [`getCustomerInfo()`](/flutter/sdk-reference/getCustomerInfo) - Fetch customer info
7 changes: 7 additions & 0 deletions content/docs/flutter/sdk-reference/SuperwallDelegate.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ abstract class SuperwallDelegate {
void paywallWillOpenDeepLink(Uri url);
void handleSuperwallDeepLink(Uri fullURL, List<String> pathComponents, Map<String, String> queryParameters);
void customerInfoDidChange(CustomerInfo from, CustomerInfo to);
void userAttributesDidChange(Map<String, Object> newAttributes);
}
```

Expand Down Expand Up @@ -84,6 +85,12 @@ class MySuperwallDelegate extends SuperwallDelegate {
print('Customer info changed');
// Sync with your backend, update UI, etc.
}

@override
void userAttributesDidChange(Map<String, Object> newAttributes) {
print('User attributes updated: $newAttributes');
// Sync with analytics or update in-memory state.
}
}
```

Expand Down
2 changes: 1 addition & 1 deletion content/docs/flutter/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-flutter/issues).

<SdkLatestVersion version="2.4.6" repoUrl="https://github.com/superwall/Superwall-Flutter" />
<SdkLatestVersion version="2.4.7" repoUrl="https://github.com/superwall/Superwall-Flutter" />
2 changes: 2 additions & 0 deletions content/docs/flutter/sdk-reference/setUserAttributes.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ Future<void> setUserAttributes(Map<String, Object> userAttributes)
## Returns / State
Returns a `Future<void>` that completes when the user attributes are set.

If you have a [`SuperwallDelegate`](/flutter/sdk-reference/SuperwallDelegate) set, `userAttributesDidChange` is invoked after the SDK applies the updated attributes.

## Usage

Basic usage:
Expand Down