---
title: "Present flows in Observer mode - Unity"
description: "Present flows in Observer mode in your Unity app while handling purchases with your own code."
---

> **AI agents**: to search Adapty docs faster and with fewer tokens, install the Adapty skill. Claude Code (self-updating via plugin): `claude plugin marketplace add adaptyteam/adapty-skills && claude plugin install adapty-skills@adapty` — other tools: `npx skills add adaptyteam/adapty-skills --all`

If you use [Observer mode](observer-vs-full-mode), you are responsible for your own purchase logic. But you can delegate the paywall UI to the [Flow & Paywall Builder](adapty-flow-builder).

Design the screen in the builder, and the Adapty SDK renders it natively. Update its copy, layout, and pricing whenever you want, without an app release.

This guide shows how to present a flow and handle the purchase callbacks. If Adapty completes purchases for you, see [Display flows & paywalls](unity-present-paywalls) instead.

## Before you start

You need:

- **Adapty Unity SDK 4.1 or later**: Earlier versions can't render flows. To move an existing app, see the [migration guide](migration-to-unity-sdk-v4).
- **`SetObserverMode(true)` called on the configuration builder**: See the [Unity SDK installation guide](sdk-installation-unity#activate-adapty-module-of-adapty-sdk).
- **Initial store integration**: Set up Adapty [with the App Store](initial_ios) and [with Google Play](initial-android).
- **A published flow with products**: Build it in the [Flow & Paywall Builder](adapty-flow-builder) and assign [products](create-product) to it.
- **A flow placement**: [Create a placement](create-placement) and assign your flow to it.
- **The flow fetched in your app**: [Get the flow and its configuration](unity-get-pb-paywalls) before you present it.

## Implementation

In Observer mode, the SDK does not make purchases for you. When a user taps the purchase or restore button in an Adapty-rendered flow, the SDK calls your `IAdaptyUIObserverModeResolver` instead — perform the purchase or restore with your own code there.

1. Implement the `IAdaptyUIObserverModeResolver` interface:

   ```csharp showLineNumbers
   using System;
   using AdaptySDK;

   public class MyObserverModeResolver : IAdaptyUIObserverModeResolver
   {
       public void FlowViewDidInitiatePurchase(
           AdaptyUIFlowView view,
           AdaptyPaywallProduct product,
           Action onStartPurchase,
           Action onFinishPurchase
       )
       {
           onStartPurchase(); // the view shows its loading indicator
           // make the purchase with your own code,
           // then report the transaction to Adapty and call:
           onFinishPurchase(); // the view hides the loading indicator
       }

       public void FlowViewDidInitiateRestore(
           AdaptyUIFlowView view,
           Action onStartRestore,
           Action onFinishRestore
       )
       {
           onStartRestore();
           // restore purchases with your own code, then:
           onFinishRestore();
       }
   }
   ```

   The `FlowViewDidInitiatePurchase` method informs you that the user has initiated a purchase, and `FlowViewDidInitiateRestore` — that the user has initiated a restore. Trigger your custom purchase or restore flow in response.

   Also, remember to invoke the following callbacks to notify AdaptyUI about the process of the purchase or restore. This is necessary for proper flow behavior, such as showing the loader, among other things:

   | Callback           | Description                                                                      |
   | :----------------- | :------------------------------------------------------------------------------- |
   | onStartPurchase()  | The callback should be invoked to notify AdaptyUI that the purchase is started.  |
   | onFinishPurchase() | The callback should be invoked to notify AdaptyUI that the purchase is finished. |
   | onStartRestore()   | The callback should be invoked to notify AdaptyUI that the restore is started.   |
   | 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.

2. Register the resolver before presenting any screen:

   ```csharp showLineNumbers
   Adapty.SetObserverModeResolver(new MyObserverModeResolver());
   ```

   Without a registered resolver, the flow view has no way to hand the purchase over to your code, and nothing happens when the user taps the purchase button.

3. Create and present the flow view as usual: [fetch the flow and create its view](unity-get-pb-paywalls), then [present it](unity-present-paywalls). No extra parameters are needed — once the resolver is registered, every Adapty-rendered flow routes purchases and restores through it.

:::warning
Don't forget to [report the transaction and associate it with the paywall](report-transactions-observer-mode-unity). Otherwise, Adapty will not recognize the transaction and will not determine the source paywall of the purchase.
:::