@superwall/cli 2.0.0 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{apple-CkKlHBZ9.js → apple-CSzNTGHM.js} +13 -13
- package/dist/auth.d.ts +1 -1
- package/dist/auth.js +3 -3
- package/dist/{billing-XCZU_T46.js → billing-C3Q8DBU2.js} +3 -3
- package/dist/{bind-drne__Ys.js → bind-BumHTi9O.js} +4 -4
- package/dist/{build-Gpdq5QXP.js → build-Bpviiclc.js} +6 -6
- package/dist/{client-DP6Rc0t_.js → client-BL0f_yGf.js} +2 -2
- package/dist/create-BSfvpWoD.js +19 -0
- package/dist/{create-Cwc3SRWJ.js → create-BUcVG4Ab.js} +23 -23
- package/dist/{create-BBrtgUgS.js → create-CfK3PeKA.js} +6 -6
- package/dist/{doctor-C9ldpPFC.js → doctor-BWqIYcMn.js} +6 -6
- package/dist/{drivers-DNrx4LWA.js → drivers-CPhdPkW5.js} +3 -3
- package/dist/entry.js +20 -21
- package/dist/{environment-DF1qKlny.js → environment-eBXjELoN.js} +1 -1
- package/dist/{existing-78LWSsqS.js → existing-BltvQiX5.js} +2 -2
- package/dist/held-CPve03KJ.js +16 -0
- package/dist/{held-Cy8Wl4D1.js → held-DgnTFMl3.js} +6 -6
- package/dist/{integrate-DcJhpXy8.js → integrate-BRsqoe01.js} +22 -22
- package/dist/{login-B2TsCE2H.js → login-BCEH5q0U.js} +1 -1
- package/dist/login-BPOONe7n.js +16 -0
- package/dist/{login-D0lh3_JI.js → login-BbTIrCFT.js} +5 -5
- package/dist/{lookup-D-nmmAbw.js → lookup-rr1AkCJA.js} +2 -2
- package/dist/{migrate-Cfec564E.js → migrate-C9X2Vz81.js} +22 -22
- package/dist/{notification-url-YDbq6FMA.js → notification-url-CV86qiKP.js} +2 -2
- package/dist/{open-Ba2vBl1_.js → open-CcpXotHG.js} +10 -10
- package/dist/{org-D0g_q3mv.js → org-BQQDo7wm.js} +2 -2
- package/dist/{paths-DxSLdpOI.js → paths-CRlU72cq.js} +1 -1
- package/dist/{playbook-DIeb7hne.js → playbook-DVMXN7fh.js} +10 -10
- package/dist/{promote-COD4fYdz.js → promote-Da8xctzy.js} +16 -16
- package/dist/push-BV-grvQg.js +22 -0
- package/dist/{push-CncywhkQ.js → push-D6R9icWN.js} +27 -14
- package/dist/{registry-DSrosOYs.js → registry-BYVD-_h6.js} +206 -49
- package/dist/{resources-Dqr01Dep.js → resources-DLON3-61.js} +18 -6
- package/dist/{run-C9qg_QlC.js → run-Co-BwhOg.js} +2 -2
- package/dist/scan-B88OlWOt.js +4 -0
- package/dist/{scan-DLrsrFS9.js → scan-CKuk-_6W.js} +1 -1
- package/dist/{scope-V336uz8j.js → scope-DV22_Ufm.js} +4 -4
- package/dist/{selection-Rdw-ZUoG.js → selection-C2_KbLuo.js} +10 -4
- package/dist/server-C4f6ccUr.js +22 -0
- package/dist/{server-D0tGG8C4.js → server-D0d2oP-5.js} +10 -8
- package/dist/{session-CFAmMhem.js → session-B-Uz0cQ7.js} +1 -1
- package/dist/session-BuvArt1j.js +6 -0
- package/dist/{session-D_nEWKXT.js → session-C4rbE3VS.js} +41 -13
- package/dist/skills/superwall-framework/SKILL.md +7 -3
- package/dist/skills/superwall-framework/references/cli.md +1 -0
- package/dist/skills/superwall-framework/references/layout.md +34 -1
- package/dist/{skills-DMG4bpKk.js → skills-CLGJuMnF.js} +8 -8
- package/dist/{skills-BvFOa4y6.js → skills-CZcpnEnG.js} +5 -4
- package/dist/{spinner-CneRK5rk.js → spinner-C2U6QBJ9.js} +3 -3
- package/dist/{storage-s2Dnz-yl.js → storage-6h9vyiAz.js} +1 -1
- package/dist/storekit-CK9JmM2D.js +16 -0
- package/dist/{storekit-yY_kS2iR.js → storekit-CinJra3V.js} +3 -3
- package/dist/{telemetry-DtG92m5O.js → telemetry-DKyDhURo.js} +1 -1
- package/dist/{token-DzRh7dI1.js → token-DaxQgQkv.js} +1 -1
- package/dist/tools-skills/animate-onboarding/SKILL.md +467 -0
- package/dist/tools-skills/animate-onboarding/references/engine.md +494 -0
- package/dist/tools-skills/animate-onboarding/references/framework/Question.tsx +71 -0
- package/dist/tools-skills/animate-onboarding/references/framework/README.md +40 -0
- package/dist/tools-skills/animate-onboarding/references/framework/answers.ts +19 -0
- package/dist/tools-skills/animate-onboarding/references/framework/flow.ts +80 -0
- package/dist/tools-skills/animate-onboarding/references/framework/handoffs.ts +869 -0
- package/dist/tools-skills/animate-onboarding/references/framework/layout.tsx +113 -0
- package/dist/tools-skills/animate-onboarding/references/framework/motion.css +559 -0
- package/dist/tools-skills/animate-onboarding/references/framework/useStoryRouter.ts +48 -0
- package/dist/tools-skills/animate-onboarding/references/handoffs.md +375 -0
- package/dist/tools-skills/animate-onboarding/references/imageReady.ts +92 -0
- package/dist/tools-skills/animate-onboarding/references/morphFrame.ts +356 -0
- package/dist/tools-skills/animate-onboarding/references/performance.md +41 -0
- package/dist/tools-skills/animate-onboarding/references/web-runtime/README.md +17 -0
- package/dist/tools-skills/animate-onboarding/references/web-runtime/handoffs.ts +858 -0
- package/dist/tools-skills/animate-onboarding/references/web-runtime/story-motion.css +301 -0
- package/dist/tools-skills/mobile-design/SKILL.md +447 -0
- package/dist/tools-skills/mobile-design/references/responsive.md +162 -0
- package/dist/tools-skills/onboarding-questions/SKILL.md +231 -0
- package/dist/tools-skills/onboarding-questions/references/arpu-questions.md +139 -0
- package/dist/tools-skills/onboarding-questions/references/craft.md +142 -0
- package/dist/tools-skills/onboarding-questions/references/example-reflective.md +117 -0
- package/dist/tools-skills/superwall/SKILL.md +263 -0
- package/dist/tools-skills/superwall/references/api.md +303 -0
- package/dist/tools-skills/superwall/references/asa.md +166 -0
- package/dist/tools-skills/superwall/references/asc.md +95 -0
- package/dist/tools-skills/superwall/references/dashboard-links.md +57 -0
- package/dist/tools-skills/superwall/references/data-analytics.md +896 -0
- package/dist/tools-skills/superwall/references/docs.md +51 -0
- package/dist/tools-skills/superwall/references/sdk-integration.md +104 -0
- package/dist/tools-skills/superwall/references/sdk-source.md +18 -0
- package/dist/tools-skills/superwall/workflows/dashboard/playbook.md +76 -0
- package/dist/tools-skills/superwall/workflows/dashboard/setup.md +100 -0
- package/dist/tools-skills/superwall/workflows/integrate/android.md +292 -0
- package/dist/tools-skills/superwall/workflows/integrate/expo.md +272 -0
- package/dist/tools-skills/superwall/workflows/integrate/flutter.md +285 -0
- package/dist/tools-skills/superwall/workflows/integrate/ios.md +314 -0
- package/dist/tools-skills/superwall/workflows/integrate/playbook.md +83 -0
- package/dist/tools-skills/superwall/workflows/integrate/react-native.md +246 -0
- package/dist/tools-skills/superwall/workflows/migrate/adapty.md +229 -0
- package/dist/tools-skills/superwall/workflows/migrate/playbook.md +78 -0
- package/dist/tools-skills/superwall/workflows/migrate/qonversion.md +227 -0
- package/dist/tools-skills/superwall/workflows/migrate/revenuecat.md +414 -0
- package/dist/tools-skills/superwall/workflows/placements/android.md +175 -0
- package/dist/tools-skills/superwall/workflows/placements/expo.md +161 -0
- package/dist/tools-skills/superwall/workflows/placements/flutter.md +139 -0
- package/dist/tools-skills/superwall/workflows/placements/ios.md +165 -0
- package/dist/tools-skills/superwall/workflows/placements/playbook.md +69 -0
- package/dist/tools-skills/superwall/workflows/placements/react-native.md +145 -0
- package/dist/tools-skills/superwall/workflows/placements/strategy.md +222 -0
- package/dist/tools-skills/superwall/workflows/review/android.md +120 -0
- package/dist/tools-skills/superwall/workflows/review/expo.md +100 -0
- package/dist/tools-skills/superwall/workflows/review/flutter.md +99 -0
- package/dist/tools-skills/superwall/workflows/review/ios.md +108 -0
- package/dist/tools-skills/superwall/workflows/review/playbook.md +70 -0
- package/dist/tools-skills/superwall/workflows/review/react-native.md +100 -0
- package/dist/tools-skills/superwall-editor/SKILL.md +113 -0
- package/dist/tools-skills/superwall-editor/references/cli.md +135 -0
- package/dist/tools-skills/superwall-editor/references/design.md +51 -0
- package/dist/tools-skills/superwall-editor/references/native-elements.md +171 -0
- package/dist/tools-skills/superwall-editor/references/workflow.md +65 -0
- package/dist/tools-skills/superwall-editor/scripts/sw-editor.sh +662 -0
- package/dist/tools-skills/wwdc/SKILL.md +22 -0
- package/dist/tools-skills/wwdc/references/docs.md +52 -0
- package/dist/tools-skills/wwdc/scripts/wwdc.sh +266 -0
- package/dist/tools.d.ts +1 -1
- package/dist/tools.js +200 -18
- package/dist/{upgrade-Bt4Ouw1y.js → upgrade-DPo0a4Es.js} +1 -1
- package/dist/{upgrade-Cqy5orjb.js → upgrade-ffseQDMx.js} +2 -2
- package/package.json +2 -2
- package/dist/create-Yvf2gStM.js +0 -19
- package/dist/held-Ddw1XSsr.js +0 -16
- package/dist/kinds-GFXB3sYu.js +0 -11
- package/dist/login-BoBe8Psl.js +0 -16
- package/dist/push-CtD4FZQV.js +0 -22
- package/dist/scan-Cv5uOwVY.js +0 -4
- package/dist/send-BxD9yf6F.js +0 -150
- package/dist/server-z1LH94R_.js +0 -22
- package/dist/session-1AV_Bs_d.js +0 -6
- package/dist/storekit-DafAnGkM.js +0 -16
- /package/dist/{devtools-ByZ6XYnn.js → devtools-pBl_vt03.js} +0 -0
- /package/dist/{reports-DdPq4blM.js → reports-D_qbl7_u.js} +0 -0
- /package/dist/{screenshot-file-0UETadF8.js → screenshot-file-tVBfUEIi.js} +0 -0
- /package/dist/{storage-DYvmIOHa.d.ts → storage-CerJ5KLP.d.ts} +0 -0
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
# Adapty → Superwall
|
|
2
|
+
|
|
3
|
+
Definitive playbook. Read fully before editing. Superwall has no Adapty-specific
|
|
4
|
+
"using-adapty" guide, so PAYWALLS-ONLY mode uses the **generic** `PurchaseController`
|
|
5
|
+
(`/docs/ios/guides/advanced-configuration`) - mirror the RevenueCat controller shape in
|
|
6
|
+
`revenuecat.md` (beside this file), swapping RC calls for Adapty calls.
|
|
7
|
+
|
|
8
|
+
## Scope & checklist
|
|
9
|
+
|
|
10
|
+
This migrates the **SDK integration**, not the whole product. Checklist:
|
|
11
|
+
|
|
12
|
+
- [ ] Inventory Adapty SDK usage (grep §3)
|
|
13
|
+
- [ ] Map products / access levels / `getPaywall` call sites (§1)
|
|
14
|
+
- [ ] Re-create products, entitlements, campaign + placements in Superwall via CLI (§4)
|
|
15
|
+
- [ ] Swap SDK calls (activate→configure, access-level reads, present → placement, identify) (§5)
|
|
16
|
+
- [ ] Build + verify each placement; Restore Purchases as an existing subscriber (§7)
|
|
17
|
+
- [ ] FULL only: remove Adapty dependency once verified
|
|
18
|
+
- [ ] Hand back to user: **rebuild paywalls** (superwall framework or dashboard editor), attach products, connect ASC/Play
|
|
19
|
+
|
|
20
|
+
> **Important - what does NOT migrate:**
|
|
21
|
+
>
|
|
22
|
+
> - **Adapty paywall designs** (Paywall Builder / remote config) cannot be imported - they are
|
|
23
|
+
> **rebuilt** - as code with the superwall framework or in the dashboard editor.
|
|
24
|
+
> - **Historical analytics / attribution** stays in Adapty.
|
|
25
|
+
> - **Subscriber base:** there is currently no server-side subscriber migration from Adapty.
|
|
26
|
+
> Existing subscribers keep access because their purchases live with the store (StoreKit /
|
|
27
|
+
> Play Billing); the app reads them device-side via **Restore Purchases** and maps them to
|
|
28
|
+
> Superwall entitlements. No subscriber data currently moves between backends.
|
|
29
|
+
|
|
30
|
+
## Docs access - fetch live, don't trust baked text
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
curl -sL https://superwall.com/docs/llms.txt # index
|
|
34
|
+
curl -sL https://superwall.com/docs/ios/guides/advanced-configuration.md # PurchaseController protocol (swap ios→expo/flutter/android)
|
|
35
|
+
curl -sL https://superwall.com/docs/support/faq/how-to-migrate-from-another-provider-to-superwall.md
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## 1. Concept mapping
|
|
39
|
+
|
|
40
|
+
| Adapty | Superwall | Notes |
|
|
41
|
+
| ------------------------------------------------ | ----------------------------------------------------- | ------------------------------------------------------------------------------------------------------ |
|
|
42
|
+
| Product (store SKU) | **Product** (re-created) | Keep the SAME App Store / Play product id. |
|
|
43
|
+
| Paywall (Adapty Paywall Builder / remote config) | **Paywall** (rebuilt) | Design does NOT import - rebuild from scratch. |
|
|
44
|
+
| Placement (`main`, `onboarding`, …) | **Placement** (inside a **Campaign**) | Closest 1:1 - Adapty already hardcodes placement ids at call sites; reuse the names (as `snake_case`). |
|
|
45
|
+
| Access Level (e.g. `premium`) | **Entitlement** (re-created) | 1:1. Recreate each access-level id as a Superwall entitlement. |
|
|
46
|
+
| `profile.accessLevels["premium"].isActive` | `Superwall.shared.subscriptionStatus.isActive` (FULL) | Device-derived in FULL mode. |
|
|
47
|
+
| Profile (Adapty user) | Superwall user (`identify`) | |
|
|
48
|
+
| `Adapty.updateProfile` custom attributes | `Superwall.shared.setUserAttributes` | |
|
|
49
|
+
|
|
50
|
+
**Mental-model shift.** Adapty already uses placements - but you call `Adapty.getPaywall(placementId:)`,
|
|
51
|
+
fetch products, and present. In Superwall you just `register(placement:)` at the call site and the
|
|
52
|
+
**campaign** decides whether/which paywall shows. The decision moves from app code to the dashboard.
|
|
53
|
+
|
|
54
|
+
## 2. Three modes - decide who owns purchases first
|
|
55
|
+
|
|
56
|
+
Once Adapty is gone, something still has to purchase, restore, and **tell Superwall who is
|
|
57
|
+
subscribed** - Superwall only auto-detects state when its own SDK made the purchase.
|
|
58
|
+
|
|
59
|
+
### Mode A - FULL, Superwall owns purchases (default)
|
|
60
|
+
|
|
61
|
+
Remove Adapty. Superwall handles purchase/restore and computes entitlements from device records. No `PurchaseController`, no manual status setting.
|
|
62
|
+
|
|
63
|
+
### Mode B - FULL, app keeps its own purchase flow (custom UI / direct StoreKit or Play Billing)
|
|
64
|
+
|
|
65
|
+
Adapty is gone, but the app still buys through its own code and uses Superwall only for paywalls.
|
|
66
|
+
Superwall does NOT observe purchases it didn't make.
|
|
67
|
+
|
|
68
|
+
> **Important:** From advanced-configuration, verbatim: "You **must** set
|
|
69
|
+
> `Superwall.shared.subscriptionStatus` every time the user's subscription status changes, otherwise
|
|
70
|
+
> the SDK won't know who to show a paywall to." Do exactly ONE of: (1) implement a `PurchaseController`
|
|
71
|
+
> that sets `subscriptionStatus`; (2) enable observer mode - `SuperwallOptions().shouldObservePurchases = true`
|
|
72
|
+
> (then you can't call `Superwall.shared.purchase(...)`); or (3) push status manually after every
|
|
73
|
+
> purchase/restore/expiry (iOS: from a `Transaction.currentEntitlements` read +
|
|
74
|
+
> `Transaction.updates` listener; Expo/RN/Flutter: `Superwall.shared.setSubscriptionStatus(...)`).
|
|
75
|
+
> Skip this and Superwall shows paywalls to paying users.
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
curl -sL https://superwall.com/docs/ios/quickstart/tracking-subscription-state.md # + expo/ · flutter/ variants
|
|
79
|
+
curl -sL https://superwall.com/docs/ios/guides/advanced/observer-mode.md
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### Mode C - PAYWALLS-ONLY, Adapty stays the purchase controller
|
|
83
|
+
|
|
84
|
+
Keep Adapty for purchases/receipts/webhooks; Superwall only shows paywalls. Implement a Superwall
|
|
85
|
+
`PurchaseController` whose `purchase`/`restore` call Adapty, and mirror Adapty access levels into
|
|
86
|
+
`Superwall.shared.subscriptionStatus` / `setSubscriptionStatus`. Confirm the exact
|
|
87
|
+
`PurchaseController` protocol signatures live (there is no Adapty-specific sample):
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
curl -sL https://superwall.com/docs/ios/guides/advanced-configuration.md
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
_Pure observer_ (analytics-only, Adapty owns purchases AND paywalls): `SuperwallOptions.shouldObservePurchases = true`. `curl -sL https://superwall.com/docs/ios/guides/advanced/observer-mode.md`
|
|
94
|
+
|
|
95
|
+
## 3. Codebase inventory - grep these symbols
|
|
96
|
+
|
|
97
|
+
**iOS (Swift, `Adapty`):**
|
|
98
|
+
|
|
99
|
+
- Config: `Adapty.activate(` , `AdaptyConfiguration`, `Adapty.delegate`, `AdaptyDelegate`
|
|
100
|
+
- Paywall/products (→ future placements): `Adapty.getPaywall(placementId:` , `Adapty.getPaywallProducts(paywall:` , `AdaptyUI.getPaywallConfiguration`, `AdaptyPaywallController`, `paywall.remoteConfig`
|
|
101
|
+
- Purchase/restore: `Adapty.makePurchase(product:` , `Adapty.restorePurchases(`
|
|
102
|
+
- Access-level checks (→ future gates): `Adapty.getProfile(` , `profile.accessLevels[` , `.isActive`, `AdaptyDelegate.didLoadLatestProfile`
|
|
103
|
+
- Identity/attributes: `Adapty.identify(` , `Adapty.logout(` , `Adapty.updateProfile(` (`AdaptyProfileParameters` / `.customAttributes`)
|
|
104
|
+
|
|
105
|
+
**React Native (`react-native-adapty`):**
|
|
106
|
+
`adapty.activate('APP_KEY')`, `adapty.getPaywall(placementId)`, `adapty.getPaywallProducts(paywall)`,
|
|
107
|
+
`adapty.makePurchase(product)`, `adapty.restorePurchases()`, `adapty.getProfile()`,
|
|
108
|
+
`profile.accessLevels['premium'].isActive`, `adapty.identify(id)`, `adapty.logout()`,
|
|
109
|
+
`adapty.updateProfile({...})`, `adapty.addEventListener('onLatestProfileLoad', …)`.
|
|
110
|
+
|
|
111
|
+
**Flutter (`adapty_flutter`):**
|
|
112
|
+
`Adapty().activate(...)`, `Adapty().getPaywall(placementId: ...)`, `Adapty().getPaywallProducts(paywall: ...)`,
|
|
113
|
+
`Adapty().makePurchase(product: ...)`, `Adapty().restorePurchases()`, `Adapty().getProfile()`,
|
|
114
|
+
`profile.accessLevels['premium']?.isActive`, `Adapty().identify(...)`, `Adapty().logout()`,
|
|
115
|
+
`Adapty().updateProfile(...)`, `adaptyDelegate.didLoadLatestProfile`.
|
|
116
|
+
|
|
117
|
+
Produce: product ids, access-level ids (→ entitlements), and one row per `getPaywall`/present call site → placement (reuse Adapty's placement id, `snake_case`).
|
|
118
|
+
|
|
119
|
+
## 4. Dashboard-side re-creation (CLI)
|
|
120
|
+
|
|
121
|
+
```bash
|
|
122
|
+
superwall entitlements create premium --project <projectId> --json
|
|
123
|
+
superwall products create com.app.premium_monthly --name "Premium Monthly" --project <projectId> --json
|
|
124
|
+
superwall products create com.app.premium_yearly --name "Premium Yearly" --project <projectId> --json
|
|
125
|
+
superwall campaigns create "Main paywall" main --project <projectId> --app <appId> --json
|
|
126
|
+
superwall campaigns placement <campaignId> onboarding --project <projectId> --app <appId> --json
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
Product ids MUST equal existing App Store / Play SKUs (import from ASC via `superwall asc keys set --help`).
|
|
130
|
+
Verify with the same explicit ids: `superwall entitlements list --project <projectId> --json`,
|
|
131
|
+
`superwall products list --project <projectId> --json`, and `superwall campaigns list --project <projectId> --app <appId> --json`.
|
|
132
|
+
|
|
133
|
+
## 5. Code replacement
|
|
134
|
+
|
|
135
|
+
### FULL mode
|
|
136
|
+
|
|
137
|
+
- **Configure.** Replace `Adapty.activate(...)` with `Superwall.configure(apiKey: "…")`. No purchase controller.
|
|
138
|
+
- **Access-level checks → subscriptionStatus.**
|
|
139
|
+
```swift
|
|
140
|
+
// Before
|
|
141
|
+
let profile = try? await Adapty.getProfile()
|
|
142
|
+
return profile?.accessLevels["premium"]?.isActive ?? false
|
|
143
|
+
// After
|
|
144
|
+
if Superwall.shared.subscriptionStatus.isActive { /* entitled */ }
|
|
145
|
+
// per-entitlement: switch Superwall.shared.subscriptionStatus { case .active(let e): … ; case .inactive: … ; case .unknown: … }
|
|
146
|
+
```
|
|
147
|
+
- **Presentation → placement.** Replace `getPaywall` + `getPaywallProducts` + present with:
|
|
148
|
+
```swift
|
|
149
|
+
Superwall.shared.register(placement: "main") { unlockFeature() }
|
|
150
|
+
```
|
|
151
|
+
RN: `Superwall.shared.register({ placement: "main" }, () => {...})`.
|
|
152
|
+
Flutter: `Superwall.shared.registerPlacement("main", feature: () {...})`.
|
|
153
|
+
- **Identity.** `Adapty.identify(id)` → `Superwall.shared.identify(userId: id)`; `Adapty.logout()` → `Superwall.shared.reset()`.
|
|
154
|
+
- **Attributes.** `Adapty.updateProfile(params)` (customAttributes) → `Superwall.shared.setUserAttributes([...])`. Call `identify` BEFORE `setUserAttributes`.
|
|
155
|
+
- Remove the Adapty dependency only after build + verification.
|
|
156
|
+
|
|
157
|
+
### PAYWALLS-ONLY mode - bridge to Adapty
|
|
158
|
+
|
|
159
|
+
Build a Superwall `PurchaseController` (confirm signatures at advanced-configuration). Skeleton,
|
|
160
|
+
mirroring the RC pattern with Adapty calls:
|
|
161
|
+
|
|
162
|
+
```swift
|
|
163
|
+
final class AdaptyPurchaseController: PurchaseController {
|
|
164
|
+
func syncSubscriptionStatus() {
|
|
165
|
+
// Adapty is the source of truth. On every profile update (AdaptyDelegate.didLoadLatestProfile
|
|
166
|
+
// or an initial getProfile), map active access levels → Superwall entitlements:
|
|
167
|
+
// let ents = profile.accessLevels.filter { $0.value.isActive }.keys.map { Entitlement(id: $0) }
|
|
168
|
+
// Superwall.shared.subscriptionStatus = ents.isEmpty ? .inactive : .active(Set(ents))
|
|
169
|
+
}
|
|
170
|
+
func purchase(product: SuperwallKit.StoreProduct) async -> PurchaseResult {
|
|
171
|
+
// Resolve the matching AdaptyPaywallProduct (or make an Adapty purchase by product id),
|
|
172
|
+
// call Adapty.makePurchase(product:), map its result → .purchased / .cancelled / .pending / .failed(error)
|
|
173
|
+
}
|
|
174
|
+
func restorePurchases() async -> RestorationResult {
|
|
175
|
+
// try await Adapty.restorePurchases(); return .restored (catch → .failed(error))
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
Wire: `Superwall.configure(apiKey: "…", purchaseController: AdaptyPurchaseController())` then start the sync.
|
|
181
|
+
Set `AdaptyDelegate` so `didLoadLatestProfile` drives `Superwall.shared.subscriptionStatus` (iOS) /
|
|
182
|
+
`setSubscriptionStatus(...)` (RN/Flutter). Confirm the exact `PurchaseController` method signatures and
|
|
183
|
+
`PurchaseResult`/`RestorationResult` cases at the advanced-configuration doc before finalizing.
|
|
184
|
+
|
|
185
|
+
## 6. Feature gating
|
|
186
|
+
|
|
187
|
+
Set per placement in the editor (**General → Feature Gating**): non-gated (closure runs on dismiss
|
|
188
|
+
regardless) vs gated (only when entitled). Peek: `Superwall.shared.getPresentationResult(forPlacement:)`.
|
|
189
|
+
`curl -sL https://superwall.com/docs/ios/quickstart/feature-gating.md`
|
|
190
|
+
|
|
191
|
+
## 7. Order of operations + safety
|
|
192
|
+
|
|
193
|
+
1. Re-create entitlements/products/campaign+placements (CLI); import products from ASC/Play so ids match.
|
|
194
|
+
2. **Rebuild** paywalls (superwall framework or dashboard editor), attach products (hand-back to user - designs do not import).
|
|
195
|
+
3. Add Superwall SDK alongside Adapty; configure it.
|
|
196
|
+
4. Replace `getPaywall`/present call sites with `register(placement:)`; replace access-level reads with `subscriptionStatus`.
|
|
197
|
+
5. Build, present each placement, Restore Purchases as an existing subscriber, confirm `subscriptionStatus.isActive`.
|
|
198
|
+
6. FULL: remove controller + Adapty dependency. PAYWALLS-ONLY: keep Adapty + controller.
|
|
199
|
+
7. Never delete Adapty dashboard/webhook config until verified in production. Existing subscribers keep access via device-side Restore Purchases (Superwall reads store records) - no server-side subscriber migration currently exists.
|
|
200
|
+
|
|
201
|
+
## 8. Pitfalls
|
|
202
|
+
|
|
203
|
+
- **Double-finish / double-charge.** Exactly one SDK finishes transactions. PAYWALLS-ONLY: Adapty owns purchasing via the controller; never also call `Superwall.shared.purchase`. FULL: remove Adapty purchase paths.
|
|
204
|
+
- **StoreKit listener conflicts.** Two SDKs observing StoreKit → duplicate grants/races. One owner only.
|
|
205
|
+
- **Silent "everyone sees a paywall" bug (Mode B).** Removed Adapty but kept the app's own purchase
|
|
206
|
+
flow (custom UI / direct StoreKit / Play Billing) without syncing state → Superwall treats every user
|
|
207
|
+
as unsubscribed and shows paywalls to payers. Grep for `purchase(` / `Transaction.updates` /
|
|
208
|
+
`BillingClient` outside Superwall; if purchases happen outside Superwall, sync via controller,
|
|
209
|
+
observer mode, or a manual `subscriptionStatus` set (§2 Mode B).
|
|
210
|
+
- **Observer flag.** `shouldObservePurchases = true` disables `Superwall.shared.purchase`; observer mode only.
|
|
211
|
+
- **Entitlement id mismatch.** Superwall entitlement ids must equal Adapty access-level ids exactly (`premium` ≠ `Premium`).
|
|
212
|
+
- **Access-level nuances.** Adapty access levels also carry grace-period / lifetime / billing-issue states; when mirroring, treat `isActive` (incl. grace period per your policy) as entitled - don't silently drop grace-period users.
|
|
213
|
+
- **Cache during switchover.** Status may read `.unknown`/`.inactive` until the first profile load / StoreKit sync - prompt Restore Purchases if a known subscriber looks free.
|
|
214
|
+
- **identify order.** `identify` before `setUserAttributes`.
|
|
215
|
+
- **Unverified controller signatures.** The Adapty controller above is a skeleton - verify `PurchaseController` protocol + result enums at the advanced-configuration doc, since there's no official Adapty sample.
|
|
216
|
+
|
|
217
|
+
## 9. Deeper docs (fetch live)
|
|
218
|
+
|
|
219
|
+
```bash
|
|
220
|
+
curl -sL https://superwall.com/docs/support/faq/how-to-migrate-from-another-provider-to-superwall.md
|
|
221
|
+
curl -sL https://superwall.com/docs/ios/guides/advanced-configuration.md # PurchaseController (+ expo/flutter/android)
|
|
222
|
+
curl -sL https://superwall.com/docs/ios/guides/advanced/observer-mode.md
|
|
223
|
+
curl -sL https://superwall.com/docs/ios/quickstart/tracking-subscription-state.md
|
|
224
|
+
curl -sL https://superwall.com/docs/llms.txt # index
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
- PurchaseController reference: https://superwall.com/docs/ios/sdk-reference/PurchaseController
|
|
228
|
+
- register/identify/setUserAttributes: https://superwall.com/docs/ios/sdk-reference/register · .../identify · .../setUserAttributes
|
|
229
|
+
- Adapty side: https://adapty.io/docs/ios-sdk-overview · https://adapty.io/docs/making-purchases · RN https://adapty.io/docs/react-native-making-purchases · Flutter https://adapty.io/docs/flutter-sdk-making-purchases
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
# Migrate to Superwall
|
|
2
|
+
|
|
3
|
+
> **Important - what does and does not migrate:**
|
|
4
|
+
>
|
|
5
|
+
> - Paywall designs are rebuilt from scratch - as code with the superwall framework
|
|
6
|
+
> (`superwall create`) or in the dashboard editor.
|
|
7
|
+
> - Historical analytics and attribution stay in the old provider.
|
|
8
|
+
> - Adapty/Qonversion subscribers do not currently move server-side; existing
|
|
9
|
+
> purchases are recovered from the store through Restore Purchases.
|
|
10
|
+
> - RevenueCat: Superwall provides server-side migration tooling that ports
|
|
11
|
+
> subscription history and entitlement state - fetch the live migration guide
|
|
12
|
+
> for the current process before promising specifics. Restore Purchases works
|
|
13
|
+
> regardless.
|
|
14
|
+
|
|
15
|
+
## Docs access
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
curl -sL https://superwall.com/docs/llms.txt
|
|
19
|
+
curl -sL https://superwall.com/docs/{path}.md
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
Fetch the framework's configure, purchase-controller, subscription-state,
|
|
23
|
+
identity, register, and feature-gating pages before changing APIs.
|
|
24
|
+
|
|
25
|
+
## Route to exactly one provider playbook
|
|
26
|
+
|
|
27
|
+
| Detect | Read fully |
|
|
28
|
+
| ------------------------------------------------------------- | -------------------------- |
|
|
29
|
+
| `RevenueCat`, `react-native-purchases`, `purchases_flutter` | `revenuecat.md` (beside this file) |
|
|
30
|
+
| `Adapty`, `react-native-adapty`, `adapty_flutter` | `adapty.md` (beside this file) |
|
|
31
|
+
| `Qonversion`, `react-native-qonversion`, `qonversion_flutter` | `qonversion.md` (beside this file) |
|
|
32
|
+
|
|
33
|
+
If several exist, identify which one owns purchases before proceeding.
|
|
34
|
+
|
|
35
|
+
## Flow
|
|
36
|
+
|
|
37
|
+
1. Inventory configure, purchase, restore, entitlement, identity, attributes,
|
|
38
|
+
presentation calls, and all callback side effects.
|
|
39
|
+
2. Choose billing ownership: Superwall, retained custom/store billing, or the
|
|
40
|
+
existing provider as a purchase controller. Follow the chosen playbook.
|
|
41
|
+
3. Map store product ids unchanged, provider entitlements/access levels to
|
|
42
|
+
Superwall entitlements, and each presentation call site to a placement.
|
|
43
|
+
4. Run `superwall apps list --json`; match the code's public key or bundle id and
|
|
44
|
+
record explicit project/app ids. Stop on an account mismatch.
|
|
45
|
+
5. Recreate only missing dashboard resources with scoped JSON commands.
|
|
46
|
+
6. Add Superwall alongside the provider, replace presentation with placements,
|
|
47
|
+
preserve purchase/restore side effects and identity lifecycle, then build.
|
|
48
|
+
7. Verify every placement and Restore Purchases as an existing subscriber.
|
|
49
|
+
8. Remove the old SDK only in full-migration mode and only after verification.
|
|
50
|
+
9. Hand back migrated code, created ids, evidence, and every remaining manual step.
|
|
51
|
+
|
|
52
|
+
## Non-negotiable seams
|
|
53
|
+
|
|
54
|
+
- Exactly one purchase owner and transaction finisher.
|
|
55
|
+
- Purchases outside Superwall must continuously sync subscription state through
|
|
56
|
+
a purchase controller, observer mode, or explicit status updates.
|
|
57
|
+
- Preserve backend sync, analytics, attribution, cache refresh, and navigation
|
|
58
|
+
from old purchase/restore callbacks.
|
|
59
|
+
- Identify before placements can fire; reset on logout, deletion, and forced
|
|
60
|
+
session expiry.
|
|
61
|
+
- Put remotely gated work inside the placement feature callback.
|
|
62
|
+
- Never create dashboard resources until the logged-in app match is verified.
|
|
63
|
+
|
|
64
|
+
## CLI contract
|
|
65
|
+
|
|
66
|
+
Agents always use `--json` and explicit scope:
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
superwall whoami --json
|
|
70
|
+
superwall apps list --json
|
|
71
|
+
superwall entitlements list --project <projectId> --json
|
|
72
|
+
superwall entitlements create <id> --project <projectId> --json
|
|
73
|
+
superwall products list --project <projectId> --json
|
|
74
|
+
superwall products create <storeId> --project <projectId> --json
|
|
75
|
+
superwall campaigns list --project <projectId> --app <appId> --json
|
|
76
|
+
superwall campaigns create "<description>" <placement> --project <projectId> --app <appId> --json
|
|
77
|
+
superwall campaigns placement <campaignId> <placement> --project <projectId> --app <appId> --json
|
|
78
|
+
```
|
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
# Qonversion → Superwall
|
|
2
|
+
|
|
3
|
+
Definitive playbook. Read fully before editing. Superwall has no Qonversion-specific
|
|
4
|
+
"using-qonversion" guide, so PAYWALLS-ONLY mode uses the **generic** `PurchaseController`
|
|
5
|
+
(`/docs/ios/guides/advanced-configuration`) - mirror the RevenueCat controller shape in
|
|
6
|
+
`revenuecat.md` (beside this file), swapping RC calls for Qonversion calls.
|
|
7
|
+
|
|
8
|
+
## Scope & checklist
|
|
9
|
+
|
|
10
|
+
This migrates the **SDK integration**, not the whole product. Checklist:
|
|
11
|
+
|
|
12
|
+
- [ ] Inventory Qonversion SDK usage (grep §3)
|
|
13
|
+
- [ ] Map products / entitlements / offering-fetch call sites (§1)
|
|
14
|
+
- [ ] Re-create products, entitlements, campaign + placements in Superwall via CLI (§4)
|
|
15
|
+
- [ ] Swap SDK calls (init→configure, entitlement reads, present → placement, identify) (§5)
|
|
16
|
+
- [ ] Build + verify each placement; Restore Purchases as an existing subscriber (§7)
|
|
17
|
+
- [ ] FULL only: remove Qonversion dependency once verified
|
|
18
|
+
- [ ] Hand back to user: **rebuild paywalls** (superwall framework or dashboard editor), attach products, connect ASC/Play
|
|
19
|
+
|
|
20
|
+
> **Important - what does NOT migrate:**
|
|
21
|
+
>
|
|
22
|
+
> - **Qonversion paywall UI** cannot be imported - paywalls are **rebuilt** - as code with the superwall framework or in the dashboard editor.
|
|
23
|
+
> - **Historical analytics / attribution** stays in Qonversion.
|
|
24
|
+
> - **Subscriber base:** there is currently no server-side subscriber migration from Qonversion.
|
|
25
|
+
> Existing subscribers keep access because their purchases live with the store (StoreKit /
|
|
26
|
+
> Play Billing); the app reads them device-side via **Restore Purchases** and maps them to
|
|
27
|
+
> Superwall entitlements. No subscriber data currently moves between backends.
|
|
28
|
+
|
|
29
|
+
## Docs access - fetch live, don't trust baked text
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
curl -sL https://superwall.com/docs/llms.txt # index
|
|
33
|
+
curl -sL https://superwall.com/docs/ios/guides/advanced-configuration.md # PurchaseController protocol (swap ios→expo/flutter/android)
|
|
34
|
+
curl -sL https://superwall.com/docs/support/faq/how-to-migrate-from-another-provider-to-superwall.md
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## 1. Concept mapping
|
|
38
|
+
|
|
39
|
+
| Qonversion | Superwall | Notes |
|
|
40
|
+
| ------------------------------------------ | ---------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- |
|
|
41
|
+
| Product (store SKU, Qonversion dashboard) | **Product** (re-created) | Keep the SAME App Store / Play product id. |
|
|
42
|
+
| Offering (remote product collection) | **Paywall** + **Campaign** | Qonversion swaps products remotely via offerings; Superwall swaps the whole paywall remotely via campaign rules. |
|
|
43
|
+
| Entitlement / Permission (e.g. `premium`) | **Entitlement** (re-created) | 1:1. Recreate each entitlement id as a Superwall entitlement. |
|
|
44
|
+
| `entitlements["premium"].isActive` | `Superwall.shared.subscriptionStatus.isActive` (FULL) | Device-derived in FULL mode. |
|
|
45
|
+
| User (Qonversion) + `identify` | Superwall user (`identify`) | |
|
|
46
|
+
| `setUserProperty` | `Superwall.shared.setUserAttributes` | |
|
|
47
|
+
| Where you fetch an offering and present UI | **Placement** at the call site (paywall rebuilt in editor) | |
|
|
48
|
+
|
|
49
|
+
**Mental-model shift.** With Qonversion you `checkEntitlements()`, then fetch an `offering` and
|
|
50
|
+
present your own paywall UI. In Superwall you `register(placement:)` at the call site and the
|
|
51
|
+
**campaign** decides whether/which paywall shows. Move the decision from app code to the dashboard.
|
|
52
|
+
|
|
53
|
+
## 2. Three modes - decide who owns purchases first
|
|
54
|
+
|
|
55
|
+
Once Qonversion is gone, something still has to purchase, restore, and **tell Superwall who is
|
|
56
|
+
subscribed** - Superwall only auto-detects state when its own SDK made the purchase.
|
|
57
|
+
|
|
58
|
+
### Mode A - FULL, Superwall owns purchases (default)
|
|
59
|
+
|
|
60
|
+
Remove Qonversion. Superwall handles purchase/restore and computes entitlements from device records. No `PurchaseController`, no manual status setting.
|
|
61
|
+
|
|
62
|
+
### Mode B - FULL, app keeps its own purchase flow (custom UI / direct StoreKit or Play Billing)
|
|
63
|
+
|
|
64
|
+
Qonversion is gone, but the app still buys through its own code and uses Superwall only for paywalls.
|
|
65
|
+
Superwall does NOT observe purchases it didn't make.
|
|
66
|
+
|
|
67
|
+
> **Important:** From advanced-configuration, verbatim: "You **must** set
|
|
68
|
+
> `Superwall.shared.subscriptionStatus` every time the user's subscription status changes, otherwise
|
|
69
|
+
> the SDK won't know who to show a paywall to." Do exactly ONE of: (1) implement a `PurchaseController`
|
|
70
|
+
> that sets `subscriptionStatus`; (2) enable observer mode - `SuperwallOptions().shouldObservePurchases = true`
|
|
71
|
+
> (then you can't call `Superwall.shared.purchase(...)`); or (3) push status manually after every
|
|
72
|
+
> purchase/restore/expiry (iOS: from a `Transaction.currentEntitlements` read +
|
|
73
|
+
> `Transaction.updates` listener; Expo/RN/Flutter: `Superwall.shared.setSubscriptionStatus(...)`).
|
|
74
|
+
> Skip this and Superwall shows paywalls to paying users.
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
curl -sL https://superwall.com/docs/ios/quickstart/tracking-subscription-state.md # + expo/ · flutter/ variants
|
|
78
|
+
curl -sL https://superwall.com/docs/ios/guides/advanced/observer-mode.md
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### Mode C - PAYWALLS-ONLY, Qonversion stays the purchase controller
|
|
82
|
+
|
|
83
|
+
Keep Qonversion for purchases/receipts/webhooks; Superwall only shows paywalls. Implement a
|
|
84
|
+
Superwall `PurchaseController` whose `purchase`/`restore` call Qonversion, and mirror Qonversion
|
|
85
|
+
entitlements into `Superwall.shared.subscriptionStatus` / `setSubscriptionStatus`. Confirm exact
|
|
86
|
+
`PurchaseController` signatures live (no Qonversion-specific sample exists):
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
curl -sL https://superwall.com/docs/ios/guides/advanced-configuration.md
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
_Pure observer_ (analytics-only, Qonversion owns purchases AND paywalls): `SuperwallOptions.shouldObservePurchases = true`. `curl -sL https://superwall.com/docs/ios/guides/advanced/observer-mode.md`
|
|
93
|
+
|
|
94
|
+
## 3. Codebase inventory - grep these symbols
|
|
95
|
+
|
|
96
|
+
**iOS (Swift, `Qonversion`):**
|
|
97
|
+
|
|
98
|
+
- Config: `Qonversion.initWithConfig(` , `Qonversion.shared(`, `Qonversion.Configuration`
|
|
99
|
+
- Offerings/products (→ future placements): `Qonversion.shared().offerings(` , `.products(`, `offering.products`
|
|
100
|
+
- Purchase/restore: `.purchase(` , `.purchaseProduct(`, `.restore(`
|
|
101
|
+
- Entitlement checks (→ future gates): `.checkEntitlements(` , `.entitlements(`, `entitlements["premium"]`, `.isActive`
|
|
102
|
+
- Identity/attributes: `.identify(` , `.logout(`, `.setUserProperty(`, `.setCustomUserProperty(`
|
|
103
|
+
|
|
104
|
+
**React Native (`react-native-qonversion`):**
|
|
105
|
+
`Qonversion.initialize(config)`, `Qonversion.getSharedInstance()`, `.offerings()`, `.products()`,
|
|
106
|
+
`.purchaseProduct()` / `.purchase()`, `.restore()`, `.checkEntitlements()`, `entitlements['premium'].isActive`,
|
|
107
|
+
`.identify(userId)`, `.logout()`, `.setUserProperty()` / `.setCustomUserProperty()`.
|
|
108
|
+
|
|
109
|
+
**Flutter (`qonversion_flutter`):**
|
|
110
|
+
`Qonversion.initialize(config)`, `Qonversion.getSharedInstance()`, `.offerings()`, `.products()`,
|
|
111
|
+
`.purchase(id)` / `.purchaseProduct(product)`, `.restore()`, `.checkEntitlements()`,
|
|
112
|
+
`entitlements['premium']?.isActive`, `.identify(userId)`, `.logout()`, `.setUserProperty()` / `.setCustomUserProperty()`.
|
|
113
|
+
|
|
114
|
+
Produce: product ids, entitlement/permission ids (→ entitlements), and one row per offering-fetch/present call site → placement (`snake_case`).
|
|
115
|
+
|
|
116
|
+
## 4. Dashboard-side re-creation (CLI)
|
|
117
|
+
|
|
118
|
+
```bash
|
|
119
|
+
superwall entitlements create premium --project <projectId> --json
|
|
120
|
+
superwall products create com.app.premium_monthly --name "Premium Monthly" --project <projectId> --json
|
|
121
|
+
superwall products create com.app.premium_yearly --name "Premium Yearly" --project <projectId> --json
|
|
122
|
+
superwall campaigns create "Main paywall" paywall_main --project <projectId> --app <appId> --json
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
Product ids MUST equal existing App Store / Play SKUs (import from ASC via `superwall asc keys set --help`).
|
|
126
|
+
Verify with the same explicit ids: `superwall entitlements list --project <projectId> --json`,
|
|
127
|
+
`superwall products list --project <projectId> --json`, and `superwall campaigns list --project <projectId> --app <appId> --json`.
|
|
128
|
+
|
|
129
|
+
## 5. Code replacement
|
|
130
|
+
|
|
131
|
+
### FULL mode
|
|
132
|
+
|
|
133
|
+
- **Configure.** Replace `Qonversion.initWithConfig(...)` with `Superwall.configure(apiKey: "…")`. No purchase controller.
|
|
134
|
+
- **Entitlement checks → subscriptionStatus.**
|
|
135
|
+
```swift
|
|
136
|
+
// Before
|
|
137
|
+
Qonversion.shared().checkEntitlements { entitlements, error in
|
|
138
|
+
let active = entitlements["premium"]?.isActive ?? false
|
|
139
|
+
}
|
|
140
|
+
// After
|
|
141
|
+
if Superwall.shared.subscriptionStatus.isActive { /* entitled */ }
|
|
142
|
+
// per-entitlement: switch Superwall.shared.subscriptionStatus { case .active(let e): … ; case .inactive: … ; case .unknown: … }
|
|
143
|
+
```
|
|
144
|
+
- **Presentation → placement.** Replace offering fetch + present with:
|
|
145
|
+
```swift
|
|
146
|
+
Superwall.shared.register(placement: "paywall_main") { unlockFeature() }
|
|
147
|
+
```
|
|
148
|
+
RN: `Superwall.shared.register({ placement: "paywall_main" }, () => {...})`.
|
|
149
|
+
Flutter: `Superwall.shared.registerPlacement("paywall_main", feature: () {...})`.
|
|
150
|
+
- **Identity.** `Qonversion.shared().identify(id)` → `Superwall.shared.identify(userId: id)`; `.logout()` → `Superwall.shared.reset()`.
|
|
151
|
+
- **Attributes.** `.setUserProperty(...)` / `.setCustomUserProperty(...)` → `Superwall.shared.setUserAttributes([...])`. Call `identify` BEFORE `setUserAttributes`.
|
|
152
|
+
- Remove the Qonversion dependency only after build + verification.
|
|
153
|
+
|
|
154
|
+
### PAYWALLS-ONLY mode - bridge to Qonversion
|
|
155
|
+
|
|
156
|
+
Build a Superwall `PurchaseController` (confirm signatures at advanced-configuration). Skeleton,
|
|
157
|
+
mirroring the RC pattern with Qonversion calls:
|
|
158
|
+
|
|
159
|
+
```swift
|
|
160
|
+
final class QonversionPurchaseController: PurchaseController {
|
|
161
|
+
func syncSubscriptionStatus() {
|
|
162
|
+
// Qonversion is the source of truth. On launch and after purchase/restore, call
|
|
163
|
+
// Qonversion.shared().checkEntitlements and map active entitlements → Superwall entitlements:
|
|
164
|
+
// let ents = entitlements.values.filter { $0.isActive }.map { Entitlement(id: $0.id) }
|
|
165
|
+
// Superwall.shared.subscriptionStatus = ents.isEmpty ? .inactive : .active(Set(ents))
|
|
166
|
+
// (Qonversion has no continuous stream - re-check after each purchase/restore and on foreground.)
|
|
167
|
+
}
|
|
168
|
+
func purchase(product: SuperwallKit.StoreProduct) async -> PurchaseResult {
|
|
169
|
+
// Resolve the Qonversion product by id, call Qonversion.shared().purchaseProduct(...),
|
|
170
|
+
// map result → .purchased / .cancelled / .pending / .failed(error)
|
|
171
|
+
}
|
|
172
|
+
func restorePurchases() async -> RestorationResult {
|
|
173
|
+
// Qonversion.shared().restore(...); on success return .restored (catch → .failed(error))
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
Wire: `Superwall.configure(apiKey: "…", purchaseController: QonversionPurchaseController())` then start the sync.
|
|
179
|
+
RN/Flutter: drive `Superwall.shared.setSubscriptionStatus(...)` from `checkEntitlements()` results after
|
|
180
|
+
each purchase/restore/foreground. Confirm exact `PurchaseController` signatures and
|
|
181
|
+
`PurchaseResult`/`RestorationResult` cases at the advanced-configuration doc before finalizing.
|
|
182
|
+
|
|
183
|
+
## 6. Feature gating
|
|
184
|
+
|
|
185
|
+
Set per placement in the editor (**General → Feature Gating**): non-gated (closure runs on dismiss
|
|
186
|
+
regardless) vs gated (only when entitled). Peek: `Superwall.shared.getPresentationResult(forPlacement:)`.
|
|
187
|
+
`curl -sL https://superwall.com/docs/ios/quickstart/feature-gating.md`
|
|
188
|
+
|
|
189
|
+
## 7. Order of operations + safety
|
|
190
|
+
|
|
191
|
+
1. Re-create entitlements/products/campaign+placements (CLI); import products from ASC/Play so ids match.
|
|
192
|
+
2. **Rebuild** paywalls (superwall framework or dashboard editor), attach products (hand-back to user - designs do not import).
|
|
193
|
+
3. Add Superwall SDK alongside Qonversion; configure it.
|
|
194
|
+
4. Replace offering-fetch/present call sites with `register(placement:)`; replace `checkEntitlements` reads with `subscriptionStatus`.
|
|
195
|
+
5. Build, present each placement, Restore Purchases as an existing subscriber, confirm `subscriptionStatus.isActive`.
|
|
196
|
+
6. FULL: remove controller + Qonversion dependency. PAYWALLS-ONLY: keep Qonversion + controller.
|
|
197
|
+
7. Never delete Qonversion dashboard/webhook config until verified in production. Existing subscribers keep access via device-side Restore Purchases (Superwall reads store records) - no server-side subscriber migration currently exists.
|
|
198
|
+
|
|
199
|
+
## 8. Pitfalls
|
|
200
|
+
|
|
201
|
+
- **Double-finish / double-charge.** Exactly one SDK finishes transactions. PAYWALLS-ONLY: Qonversion owns purchasing via the controller; never also call `Superwall.shared.purchase`. FULL: remove Qonversion purchase paths.
|
|
202
|
+
- **StoreKit listener conflicts.** Two SDKs observing StoreKit → duplicate grants/races. One owner only.
|
|
203
|
+
- **Silent "everyone sees a paywall" bug (Mode B).** Removed Qonversion but kept the app's own purchase
|
|
204
|
+
flow (custom UI / direct StoreKit / Play Billing) without syncing state → Superwall treats every user
|
|
205
|
+
as unsubscribed and shows paywalls to payers. Grep for `purchase(` / `Transaction.updates` /
|
|
206
|
+
`BillingClient` outside Superwall; if purchases happen outside Superwall, sync via controller,
|
|
207
|
+
observer mode, or a manual `subscriptionStatus` set (§2 Mode B).
|
|
208
|
+
- **Observer flag.** `shouldObservePurchases = true` disables `Superwall.shared.purchase`; observer mode only.
|
|
209
|
+
- **Entitlement id mismatch.** Superwall entitlement ids must equal Qonversion entitlement/permission ids exactly (`premium` ≠ `Premium`).
|
|
210
|
+
- **No continuous stream.** Unlike RC's `customerInfoStream`, Qonversion has no push stream - re-run `checkEntitlements` after each purchase/restore and on app foreground so `subscriptionStatus` stays fresh.
|
|
211
|
+
- **Cache during switchover.** Status may read `.unknown`/`.inactive` until the first `checkEntitlements` / StoreKit sync - prompt Restore Purchases if a known subscriber looks free.
|
|
212
|
+
- **identify order.** `identify` before `setUserAttributes`.
|
|
213
|
+
- **Unverified controller signatures.** The Qonversion controller above is a skeleton - verify `PurchaseController` protocol + result enums at the advanced-configuration doc, since there's no official Qonversion sample.
|
|
214
|
+
|
|
215
|
+
## 9. Deeper docs (fetch live)
|
|
216
|
+
|
|
217
|
+
```bash
|
|
218
|
+
curl -sL https://superwall.com/docs/support/faq/how-to-migrate-from-another-provider-to-superwall.md
|
|
219
|
+
curl -sL https://superwall.com/docs/ios/guides/advanced-configuration.md # PurchaseController (+ expo/flutter/android)
|
|
220
|
+
curl -sL https://superwall.com/docs/ios/guides/advanced/observer-mode.md
|
|
221
|
+
curl -sL https://superwall.com/docs/ios/quickstart/tracking-subscription-state.md
|
|
222
|
+
curl -sL https://superwall.com/docs/llms.txt # index
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
- PurchaseController reference: https://superwall.com/docs/ios/sdk-reference/PurchaseController
|
|
226
|
+
- register/identify/setUserAttributes: https://superwall.com/docs/ios/sdk-reference/register · .../identify · .../setUserAttributes
|
|
227
|
+
- Qonversion side: https://documentation.qonversion.io/docs/making-purchases · https://documentation.qonversion.io/docs/flutter-sdk · RN https://github.com/qonversion/react-native-sdk
|