> ## Documentation Index
> Fetch the complete documentation index at: https://docs.encorekit.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Using Qonversion

> Integrate Encore with Qonversion for subscription management

## Overview

Encore works alongside Qonversion so you can present retention offers at key moments in your app. Since Qonversion doesn't include a built-in paywall component, you present Encore offers directly using `Encore.placement().show()`.

<Info>
  Qonversion handles subscription management, analytics, and attribution. Encore handles retention offer presentation and purchase delegation.
</Info>

***

## Handle Offer Results

Register handlers at app launch so Encore can delegate purchases to Qonversion.

### Register `onPurchaseRequest`

```swift theme={null}
Encore.shared.onPurchaseRequest { purchaseRequest in
    try await Qonversion.shared().purchaseProduct(productId: purchaseRequest.productId)
}
```

<Tip>
  See [onPurchaseRequest()](../sdk-reference/on-purchase-request) for complete API details and examples with other subscription managers.
</Tip>

### Register `onPassthrough`

Called when the user dismisses the offer or no offers are available. Use this to resume the user's original action.

```swift theme={null}
Encore.shared.onPassthrough { placementId in
    // Resume your original user flow
}
```

***

## Alternative: Automatic StoreKit Purchase

If you don't set `onPurchaseRequest`, Encore purchases via native StoreKit 2 automatically. You must manually sync each transaction to Qonversion so it can track entitlements.

### Setup

1. Configure Qonversion SDK in analytics mode:

```swift theme={null}
let config = Qonversion.Configuration(projectKey: "YOUR_KEY", launchMode: .analytics)
Qonversion.initWithConfig(config)
```

2. Register `onPurchaseComplete` to sync purchases:

```swift theme={null}
Encore.shared.onPurchaseComplete { transaction, productId in
    Qonversion.shared().syncStoreKit2Purchases()
}
```

***

## Configure Analytics

### Encore Webhook

Encore uses Apple's App Store Server Notifications to track subscription lifecycle events and measure offer impact. See [Configure Analytics](../quickstart/configure-analytics) for full setup instructions.

<Info>
  If Qonversion already occupies your primary App Store Server Notifications URL, use the **Forward from Your Server** option to send notifications to both Qonversion and Encore.
</Info>

### Qonversion Webhook

If you're using the [Automatic StoreKit Purchase](#alternative-automatic-storekit-purchase) approach above, you can optionally configure Qonversion to receive App Store Server Notifications as well.

<Note>
  Qonversion's ASSN V2 webhook is optional — Qonversion can sync transactions without it. However, it improves accuracy for renewal and refund tracking.
</Note>

In App Store Connect, add the ASSN V2 webhook URL from your **Qonversion Dashboard**. If Encore is your primary URL, forward notifications to Qonversion from your server.
