> ## 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.

# Add Subscription Product with Adapty

> Route the purchase Encore requests through Adapty, or report a StoreKit purchase to it.

## Overview

You still pick the product in App Store Connect and the Encore Dashboard exactly as in [Add Subscription Product](/publishers/ios/quickstart/add-subscription-product). What changes with Adapty is how the purchase completes and how Adapty learns about it.

Adapty ships no paywall component, so [Presenting Offers](/publishers/ios/quickstart/present-offers) needs no change: call `show()` from your own UI.

***

## Route the purchase through Adapty

Register [`onPurchaseRequest()`](/publishers/ios/sdk-reference/on-purchase-request) at app launch. Encore hands your handler the configured product id and Adapty performs the purchase, so its entitlements update the way they do for any other Adapty sale:

```swift theme={null}
Encore.shared.onPurchaseRequest { purchaseRequest in
    let products = try await Adapty.getPaywallProducts(paywall: paywall)
    guard let product = products.first(where: { $0.vendorProductId == purchaseRequest.productId }) else {
        return false
    }
    try await Adapty.makePurchase(product: product)
    return true   // → Encore dismisses the offer sheet
}
```

***

## Or report a StoreKit purchase to Adapty

Without an `onPurchaseRequest` handler, Encore purchases through StoreKit 2 itself. Adapty does not detect those transactions on its own, so run it in observer mode and report each one:

```swift theme={null}
try await Adapty.activate(with: .builder(withAPIKey: "YOUR_KEY")
    .with(observerMode: true)
    .build()
)

Encore.shared.onPurchaseComplete { transaction, productId in
    try? await Adapty.reportTransaction(transaction)
}
```

<Note>
  Adapty 3.3 and later require an explicit `reportTransaction()` call for StoreKit 2 transactions in observer mode. Full handler contract: [`onPurchaseComplete()`](/publishers/ios/sdk-reference/on-purchase-complete).
</Note>

***

## Next

* [Configure Analytics](./configure-analytics) - keep both Adapty and Encore receiving subscription events
