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
16 changes: 16 additions & 0 deletions content/docs/android/sdk-reference/SuperwallDelegate.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ interface SuperwallDelegate {
info: Map<String, Any>?,
error: Throwable?
) {}

fun userAttributesDidChange(newAttributes: Map<String, Any>) {}
}
```

Expand Down Expand Up @@ -104,6 +106,11 @@ All methods are optional to implement. Key methods include:
description: "Called after paywall dismissal.",
required: true,
},
userAttributesDidChange: {
type: "newAttributes: Map<String, Any>",
description: "Called when user attributes change outside your app (for example via the `Set Attribute` paywall action).",
required: true,
},
}}
/>

Expand Down Expand Up @@ -182,6 +189,15 @@ override fun didDismissPaywall(paywallInfo: PaywallInfo) {
}
```

Handle user attributes changes:
```kotlin
override fun userAttributesDidChange(newAttributes: Map<String, Any>) {
// React to paywall-triggered attribute updates
println("User attributes updated: $newAttributes")
refreshProfileUI(newAttributes)
}
```

Java usage:
```java
public class MainActivity extends AppCompatActivity implements SuperwallDelegateJava {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ From left to right, here's what each icon does:
- **Square on Square:** Copies the component.
- **Plus sign:** Adds a new component.

You can also select a component directly in the **live preview canvas** and use `⌘+C` (Mac) or `Ctrl+C` (Windows) to copy it, then `⌘+V` or `Ctrl+V` to paste it.

To **rename** a component, **double click** on its current name to edit it.

### Context menu
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
title: "Notifications"
---

To configure a notification which displays before a free trials ends, click the **Notifications** button from the **sidebar**
To configure a notification which displays before a free trial ends, click the **Notifications** button from the **sidebar**:

<Frame>![](/images/pe-editor-notification-sidebar.png)</Frame>

You can add a local notification that fires after a number of days when a free trial has been purchased. After the user starts a free trial, it will ask them to enable notifications if they haven't already done so.
You can add a local notification that fires before a free trial ends. After the user starts a free trial, the app will ask them to enable notifications if they haven't already done so.

<Note>In sandbox mode, the free trial reminder will fire after x minutes, instead of x days.</Note>

Expand All @@ -19,10 +19,30 @@ To turn on a trial reminder notification, click **+ Add Notification**. From the
1. **Title**: Shows at the top of the notification.
2. **Subtitle**: Displays directly below the title in a smaller font. Not required.
3. **Body**: Shows in the primary body of the notification.
4. **Delay**: Any delay you'd like to apply after the free trial begins.
4. **Delay**: How many days before the trial ends the notification should fire.

Here's where those values show up on a notification:

<Frame>![](/images/pe-editor-notification-mapping.png)</Frame>

Also, keep in mind that these will be scheduled as a local notification as soon as they are configured.
These are scheduled as local notifications as soon as they are configured.

### Dynamic notification timing

<Info>Requires iOS SDK v4.10.7+ or Android SDK v2.6.6+.</Info>

The SDK automatically calculates the actual trial end date based on the product's introductory offer period from the app store. This means notifications are scheduled relative to when the trial **actually ends** — not when it starts.

For example, if you set a delay of 3 days:

| Product trial length | Notification fires on |
| -------------------- | --------------------- |
| 7-day trial | Day 4 (3 days before end) |
| 14-day trial | Day 11 (3 days before end) |
| 1-month trial | ~Day 27 (3 days before end) |

This ensures users receive trial-ending reminders at the right time — when the reminder is actually relevant to their subscription decision — regardless of the product's trial length.

<Warning>
On older SDK versions (pre-4.10.7 on iOS), the notification fires X days **after** the trial starts rather than X days **before** it ends. Upgrade to the latest SDK for accurate timing.
</Warning>
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ Available tap actions are:

- **Purchase:** Begin a purchasing flow of the selected product.
- **Set/Update Variable:** Sets or updates an existing variable's value. Options specific to the variable type will also be displayed. For example, a **Number** variable will have an option to choose an **Operation** such as Set, Increment or Decrement. Or, a **Boolean** variable's **Operation** will offer to either **Set** or **Toggle** the boolean value.
- **Set Attribute:** Sets a user attribute directly from the paywall. Enter a **Key** (e.g., `preferredPlan`, `onboardingComplete`) and a **Value** (e.g., `premium`, `true`). You can add multiple attributes per tap using **+ Add Attribute**. This behaves the same as calling `setUserAttributes()` in the SDK. Common use cases include capturing user preferences from paywall surveys, tracking paywall engagement, or segmenting users for A/B tests based on their choices. _Requires iOS SDK v4.10.7+._
- **Select Product:** Puts the chosen product in a selected state. Useful for scenarios such as focusing a product in a paywall drawer, for example, when something is tapped or clicked.
- **Close:** Closes the paywall.
- **Restore:** Begins a purchase restore operation. Useful for restoring purchases someone may have made prior.
Expand Down
8 changes: 8 additions & 0 deletions content/docs/expo/sdk-reference/hooks/useSuperwallEvents.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ The `useSuperwallEvents` hook provides a low-level way to subscribe to *any* nat
type: "(status: SubscriptionStatus) => void",
description: "Called when the user's subscription status changes.",
},
onUserAttributesChange: {
type: "(newAttributes: Record<string, any>) => void",
description: "Called when user attributes change outside your app (for example via the `Set Attribute` paywall action).",
},
onSuperwallEvent: {
type: "(eventInfo: SuperwallEventInfo) => void",
description: "Called for generic Superwall events with payload metadata.",
Expand Down Expand Up @@ -121,6 +125,10 @@ function EventLogger() {
},
onPaywallPresent: (info) => {
console.log('Paywall Presented (via useSuperwallEvents):', info.name);
},
onUserAttributesChange: (newAttributes) => {
console.log('User Attributes Changed:', newAttributes);
// Sync with analytics or update in-memory state
}
});

Expand Down
4 changes: 2 additions & 2 deletions content/docs/flutter/sdk-reference/PaywallOptions.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ enum TransactionBackgroundView { spinner, none }
},
"restoreFailed.message": {
type: "String",
description: "Message for restore-failed alert. \"`",
default: "`\"We couldn't find an active subscription for your account",
description: "Message for restore-failed alert.",
default: "We couldn't find an active subscription for your account.",
},
"restoreFailed.closeButtonTitle": {
type: "String",
Expand Down
8 changes: 7 additions & 1 deletion content/docs/integrations/figma-plugin.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,13 @@ title: "Figma Plugin"
description: "The Superwall Figma Plugin allows designers to convert Figma designs into fully functional paywalls with one click."
---

The Superwall Figma Import plugin can automatically import Figma designs into the paywall editor. Each component is imported individually, preserving your design structure. To see it in action, check out the video demo:
The Superwall Figma Import plugin can automatically import Figma designs into the paywall editor. Each component is imported individually, preserving your design structure.

<Note>
Auto Layout is required in your Figma files for the import to work.
</Note>

To see it in action, check out the video demo:

<iframe width="640" height="360" src="https://www.youtube.com/embed/rIOw2RaONW0" title="Superwall Figma Plugin Demo" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>

Expand Down
2 changes: 1 addition & 1 deletion next-env.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/// <reference types="next" />
/// <reference types="next/image-types/global" />
import "./.next/types/routes.d.ts";
import "./.next/dev/types/routes.d.ts";

// NOTE: This file should not be edited
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.