Skip to content

post-purchase branching + updated funnels - #822

Merged
eandreeva-twr merged 4 commits into
mainfrom
ADP-8270
Nov 20, 2026
Merged

eandreeva-twr merged 4 commits into
mainfrom
ADP-8270

Conversation

@titerman

Copy link
Copy Markdown
Collaborator

No description provided.

</Details>

We recommend dismissing the screen in that case.
Close the flow after a successful purchase. To show users more screens after the purchase instead, such as a thank-you screen, leave the flow open and [set those screens up in the flow](respond-to-purchase-outcomes#add-actions-for-a-result).

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Звучит немного странно — как будто какого-то or между этими опциями не хватает, чтобы было логически более цельно

</Details>

We recommend dismissing the screen if the user has the required `accessLevel`. Refer to the [Subscription status](android-listen-subscription-changes) topic to learn how to check it.
If the user has the required `accessLevel`, close the flow. To show users more screens after the restoration instead, such as an upsell, leave the flow open and [set those screens up in the flow](respond-to-purchase-outcomes#respond-to-a-purchase-restoration). Refer to the [Subscription status](android-listen-subscription-changes) topic to learn how to verify the access level.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

То же самое (ну и в аналогичных ситуациях)


- The user starts a trial or makes a purchase on a paywall screen. A purchase closes the flow, so the user completes it on that paywall step, wherever the step is in the flow. A later refund removes the purchase from the step's **Purchases** and **Revenue**, but the user still counts as completed.
- The path ends on a last screen. A last screen is a screen with no navigation to another screen. A flow can have several of them, for example a success screen and a cancel screen. Each of them is captioned **Last screen**. When a last screen is a paywall, only users who buy on it complete the flow.
- The user starts a trial or makes a purchase on a paywall screen that closes the flow. The user completes the flow on that paywall step, wherever the step is in the flow. A later refund removes the purchase from the step's **Purchases** and **Revenue**, but the user still counts as completed.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

в целом понятно и подробно, если вчитаться, но это сложная логическая цепочка, оч хочется упростить. можно примеры привести какие-нибудь, даже визуальные. потому что это важный кусочек

Comment on lines +9 to +12
You set outcomes in the action settings, one for each purchase condition. An empty outcome keeps users on the paywall screen — close the flow yourself.

The work splits into three parts:
- The **Purchase** action has the following conditions: **When succeeded**, **When failed**, **When cancelled by user**, and **When pending**.
- The **Restore purchases** action has two conditions: **When restore completed** and **When restore failed**.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

если мы пишем тут и про скрины, и про код, это интро не соответствует тому, что будет дальше
возможно, стоит убрать отдельную секцию про хэндлинг в коде и оставить его только как tip

If the app closes the flow after a purchase and then opens a second flow, remove that code. Add the screens of the second flow to the flow that contains the paywall. Show them after a successful purchase.

To open the post-purchase flow without a wait, fetch it alongside the paywall, rather than inside the handler. Request its UI configuration too — that call is what starts caching the flow's images in the background.
## Test the outcomes

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

странная секция немного — это стандартный сценарий тестирования любой фичи пэйволов, не надо везде дублировать, наверное

### Show the next screen after a successful purchase

To fetch the post-purchase flow from your app, assign it to its own placement. Your flow's placement can't serve it too — a placement serves one flow per audience.
Pair the **When succeeded** outcome with a [**Navigate to Screen**](onboarding-actions#navigate-to-screen) action, and select the destination screen. After a successful purchase, users see the screen you selected.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

давай немного ключевых слов с юз кейсами навалим. чаще всего это онбординг или thank you screen

**When restore completed** means that the restoration finished without an error, not that the user has access. You can't verify access levels in a flow. To show content that depends on access, add **Close Flow** for **When restore completed**, and verify the [access level](access-level) in the app.

Branch on the outcome:
### Respond to purchases in Observer mode

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

по возможности лучше не упоминать observer mode в статье не про observer mode :)

#### Successful, canceled, or pending purchase

If a purchase finishes, this method will be invoked. By default, it does nothing — the flow stays open after the purchase until you dismiss it, so call `view.dismiss()` yourself once the user gets access:
If a purchase finishes, this method will be invoked. By default, it does nothing — the flow stays open after the purchase until you dismiss it. To show users more screens after the purchase, such as a thank-you screen, leave the flow open and [set those screens up in the flow](respond-to-purchase-outcomes#add-actions-for-a-result). Otherwise, call `view.dismiss()` once the user has access:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

я бы более внятно здесь показала развилку, когда им использовать эти хэндлеры, а когда действия в флоу.
хэндлеры — когда тебе надо что-то сделать в коде аппки — например, кастомное уведомление показать, куда-то перекинуть. короче, что-то в нативном коде. действия в флоу подходят для большинства случаев — закрытие флоу после успешной покупки, продолжение онбординга, thank you screen, алерт после неудачной покупки. всё то, что настраивается внутри флоу. я бы даже пушила использовать средства самого флоу, потому что тогда они могут управлять этим без релиза аппки

Comment thread src/data/sidebars/tutorial.json Outdated
"type": "doc",
"id": "respond-to-purchase-outcomes",
"label": "Respond to purchase outcomes"
"label": "Respond to purchases and purchase restorations"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

как будто чуть длинно получилось

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

изначальный вариант в целом всё покрывает)

A placement has one of three types. Two of them are for new work:

- A **flow placement** serves a [flow](adapty-flow-builder): one screen or a sequence of screens, built in the [Flow & Paywall Builder](adapty-flow-builder). A flow can be an onboarding, a paywall, or an onboarding that ends in a paywall. To build the screen yourself, use a paywall placement instead.
- A **flow placement** serves a [flow](adapty-flow-builder): one screen or a sequence of screens, built in the [Flow & Paywall Builder](adapty-flow-builder). A flow can be an onboarding, a paywall, or an onboarding that includes a paywall. To build the screen yourself, use a paywall placement instead.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

можно и просто with


Your app can respond to purchase results in its own code instead of the flow. This takes more work: each change to that code needs an app release.

The SDK passes the result of a purchase or a purchase restoration to your app first, then to the flow. The flow only receives the result while it's open. If a purchase or restoration callback in your app closes the flow, the outcome actions don't run. The default callbacks don't close the flow on any platform, so this only happens with code you added. If you use outcomes, leave the flow open in these callbacks.

@eandreeva-twr eandreeva-twr Nov 11, 2026 •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Тут не совсем так. У колбэка успешной покупки на iOS, Flutter и Unity вообще нет дефолтной реализации (её обязательно пишет приложение), а на Android дефолт ничего не делает.

A flow can continue after a paywall screen — resume the onboarding, show the new subscribers a thank-you screen, or upsell those who restore an earlier purchase.

The builder can't branch on a purchase result: no [trigger](onboarding-actions#trigger-types) fires when a purchase finishes, and no [variable](onboarding-variables) carries its outcome. So the transition belongs in your code, where the result arrives.
You set outcomes in the action settings, one for each purchase condition. An empty outcome keeps users on the paywall screen — close the flow yourself.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

«close the flow yourself» читается как обязательное действие для любого пустого outcome. А для When cancelled by user как раз нужно оставить пользователя на пэйволе, и для закрытия есть свой outcome — Close Flow. Может, просто: «An outcome without actions keeps users on the paywall screen.»

### Completed

Unique users who completed the flow: they started a trial or made a purchase on a paywall screen, or reached a last screen. The card shows the share of entered users and the count. In the table, a step's **Completed** counts the users who completed the flow on that step. In a screen row within a step, the screen's completions are a share of the step's users.
Unique users who completed the flow: they reached the last screen, started a trial, or made a purchase on a paywall screen that closes the flow. The card shows the share of entered users and the count. In the table, a step's **Completed** counts the users who completed the flow on that step. In a screen row within a step, the screen's completions are a share of the step's users.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

После перестановки читается, что любой триал = completion. В дашборде правило другое (тултип у Completed): reached a last screen, or made a purchase or started a trial on a paywall that closes the flow. Предлагаю: «they reached a last screen, or made a purchase or started a trial on a paywall screen that closes the flow.»

### Drop rate per step

Users whose path ended on the step without completing the flow, as a share of the users who reached it. In a screen row within a step, the screen's share of the step's drop-off. Hover over the value to see the screen's own drop-off rate.
Users whose path ended on the step without completing the flow, as a share of the users who reached it. Users counted in **Drop after purchase** are not included. In a screen row within a step, the screen's share of the step's drop-off. Hover over the value to see the screen's own drop-off rate.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Тут знаменатель не тот: в тултипе дашборда drop rate во вложенной строке — это доля от всех, кто дошёл до шага, а не доля от drop-off шага. Как у Drop after purchase выше: «the screen's share of the step's users».

| onFinishRestore() | The callback should be invoked to notify AdaptyUI that the restore is finished. |

The flow stays open while your code runs — dismiss it yourself after a successful purchase or restore.
The flow stays open while your code runs. Close it yourself once a purchase or a purchase restoration succeeds. To show users more screens after the purchase instead, such as a thank-you screen, leave the flow open and [set those screens up in the flow](respond-to-purchase-outcomes#add-actions-for-a-result).

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

В Observer mode флоу не знает результат покупки: onFinishPurchase() без аргументов, на iOS всегда запускает When pending, на Android — When succeeded. А вызывать его нужно в конце любой покупки, и отменённой тоже, иначе лоадер не скроется. Значит thank-you screen из outcomes покажется и после отмены.

Я бы тут не предлагала thank-you screen через флоу: в Observer mode экран после покупки лучше показывать из кода, приложение знает результат. То же самое в Unity и React Native.


After `onFinishPurchase()`, the flow runs the **When succeeded** [outcome actions](respond-to-purchase-outcomes#add-actions-for-a-result), whatever happened. After `onFinishRestore()`, the flow runs the **When restore completed** actions, whatever happened.

2. In order to display the visual flow on the device screen, you must first configure it.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Если приложение отдаёт restore handler, onFinishRestore() уже не optional: без него восстановление так и не завершится, When restore completed не запустится, а повторные нажатия на Restore будут игнорироваться. Optional он только когда restore handler не задан — тогда восстановление делает сам Adapty. Стоит поправить строки в таблице выше.

| `instanceId` | The ID of the screen the user opened. |
| `screen_order` | The screen's position in the flow. |
| `is_last_screen` | `true` when the screen has nowhere further to go. A branching flow can end on several different screens, and each one reports `true`. |
| `is_last_screen` | `true` when the screen has nowhere further to go. A branching flow can end on several different screens, and each one reports `true`. If the flow can [show another screen after a purchase or a purchase restoration](respond-to-purchase-outcomes#add-actions-for-a-result), the paywall screen reports `false`. |

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Чуть точнее: по коду paywall отдаёт false, если любой outcome его Purchase или Restore purchases ведёт на экран дальше по флоу, в том числе When failed или When cancelled by user, а не только после успешной покупки.

acrius and others added 2 commits November 20, 2026 08:14
…vice runs only success outcomes (#880)

* docs(flow-outcomes): troubleshoot skipped outcome actions, preview runs only success outcomes

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* chore(context-mill): flow-logic brief — purchase and restoration outcomes facts, ripple and open preview question

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* review

---------

Co-authored-by: dbastrikin <dbastrikin@adapty.io>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Eugene Titerman <eugene@titerman.com>
# Conflicts:
#	.claude/context-mill/zones/flow-logic.md
@eandreeva-twr
eandreeva-twr merged commit ed2e88c into main Nov 20, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants