Integrate Adapty into your iOS app with AI assistance

This guide helps you integrate Adapty into your iOS app with the help of an LLM. You’ll start by preparing your Adapty dashboard, then work through each implementation stage by sending focused doc links to your LLM. At the end, you’ll find best practices for setting up your AI tools with Adapty documentation.

Copy this entire page as Markdown and paste it into your LLM to get started — click Copy for LLM at the top of the page or open the .md version. The LLM will use the guide links and checkpoints to walk you through each stage.

Before you start: dashboard checklist

Adapty requires dashboard configuration before you write any SDK code. Your LLM cannot look up dashboard values for you — you’ll need to provide them.

Required before coding

  1. Connect your app store: In the Adapty Dashboard, go to App settings → General. This is required for purchases to work. Connect App Store

  2. Copy your Public SDK key: In the Adapty Dashboard, go to App settings → General, then find the API keys section. In code, this is the string you pass to Adapty.activate("YOUR_PUBLIC_SDK_KEY").

  3. Create at least one product: In the Adapty Dashboard, go to the Products page. You don’t reference products directly in code — Adapty delivers them through paywalls. Add products

  4. Create a paywall and a placement: In the Adapty Dashboard, create a paywall on the Paywalls page, then assign it to a placement on the Placements page. In code, the placement ID is the string you pass to Adapty.getPaywall("YOUR_PLACEMENT_ID"). Create paywall

  5. Set up access levels: In the Adapty Dashboard, configure per product on the Products page. In code, the string checked in profile.accessLevels["premium"]. The default premium access level works for most apps. If paying users get access to different features depending on the product (for example, a basic plan vs. a pro plan), create additional access levels before you start coding.

Once you have all five, you’re ready to write code. Tell your LLM: “My Public SDK key is X, my placement ID is Y” so it can generate correct initialization and paywall-fetching code.

Set up when ready

These are not required to start coding, but you’ll want them as your integration matures:

  • A/B tests: Configure on the Placements page. No code change needed. A/B tests
  • Additional paywalls and placements: Add more getPaywall calls with different placement IDs.
  • Analytics integrations: Configure on the Integrations page. Setup varies by integration. See analytics integrations and attribution integrations.

Implementation walkthrough

The rest of this guide walks through Adapty integration in implementation order. Each stage includes the docs to send to your LLM, what you should see when done, and common issues.

Plan your integration

Before jumping into code, ask your LLM to analyze your project and create an implementation plan. If your AI tool supports a planning mode (like Cursor’s or Claude Code’s plan mode), use it so the LLM can read both your project structure and the Adapty docs before writing any code.

Tell your LLM which approach you use for purchases — this affects the guides it should follow:

  • Adapty Paywall Builder: You create paywalls in Adapty’s no-code builder, and the SDK renders them automatically.
  • Manually created paywalls: You build your own paywall UI in code but still use Adapty to fetch products and handle purchases.
  • Observer mode: You keep your existing purchase infrastructure and use Adapty only for analytics and integrations.

Not sure which one to pick? Read the comparison table in the quickstart.

Install and configure the SDK

Install the Adapty SDK package via Swift Package Manager in Xcode and activate it with your Public SDK key. This is the foundation — nothing else works without it.

Guide: Install & configure Adapty SDK

Send this to your LLM:

Read these Adapty docs before writing code:
- https://adapty.io/docs/sdk-installation-ios.md

Checkpoint

  • Expected: App builds and runs. Xcode console shows Adapty activation log.
  • Gotcha: “Public API key is missing” → check you replaced the placeholder with your real key from App settings.

Show paywalls and handle purchases

Fetch a paywall by placement ID, display it, and handle purchase events. The guides you need depend on how you handle purchases.

Test each purchase in the sandbox as you go — don’t wait until the end. See Test purchases in sandbox for setup instructions.

Check subscription status

After a purchase, check the user profile for an active access level to gate premium content.

Guide: Check subscription status

Send this to your LLM:

Read these Adapty docs before writing code:
- https://adapty.io/docs/ios-check-subscription-status.md

Checkpoint

  • Expected: After a sandbox purchase, profile.accessLevels["premium"]?.isActive returns true.
  • Gotcha: Empty accessLevels after purchase → check the product has an access level assigned in the dashboard.

Identify users

Link your app user accounts to Adapty profiles so purchases persist across devices.

Skip this step if your app has no authentication.

Guide: Identify users

Send this to your LLM:

Read these Adapty docs before writing code:
- https://adapty.io/docs/ios-quickstart-identify.md

Checkpoint

  • Expected: After calling Adapty.identify("your-user-id"), the dashboard Profiles section shows your custom user ID.
  • Gotcha: Call identify after activation but before fetching paywalls to avoid anonymous profile attribution.

Prepare for release

Once your integration works in the sandbox, walk through the release checklist to make sure everything is production-ready.

Guide: Release checklist

Send this to your LLM:

Read these Adapty docs before releasing:
- https://adapty.io/docs/release-checklist.md

Checkpoint

  • Expected: All checklist items confirmed: store connection, server notifications, purchase flow, access level checks, and privacy requirements.
  • Gotcha: Missing App Store Server Notifications → configure them in App settings → iOS SDK or events won’t appear in the dashboard.

Best practices for AI tools

This section covers how to set up your LLM or AI code editor for the best results with Adapty documentation.

Use plain text docs

You can access any Adapty doc as plain text Markdown by adding .md to the end of its URL or clicking Copy for LLM under the article title. For example: https://adapty.io/docs/adapty-cursor.md.

The most practical approach is to send your LLM the .md link for the specific page you need — this keeps token usage low and gives the LLM focused context. The “Send this to your LLM” blocks in each stage above do exactly this.

If you need broader context, we also host index files:

  • llms.txt: An emerging standard for making websites accessible to LLMs. Lists all pages with .md links. Note that for some AI agents (e.g., ChatGPT) you will need to download llms.txt and upload it to the chat as a file.
  • llms-full.txt: The entire Adapty documentation site combined into a single file. Very large — use only when you need the full picture.
  • iOS-specific ios-llms.txt and ios-llms-full.txt: Platform-specific subsets that save tokens compared to the full site.

Use with Cursor

Cursor, the AI code editor, makes it easier to integrate and maintain apps with Adapty’s infrastructure. This section shows you how to configure Cursor for better results when working with Adapty’s SDK.

Add Adapty documentation to Cursor

Adding Adapty’s documentation directly to Cursor means you don’t have to switch between your code editor and browser. This setup gives you quick access to the latest implementation guides and best practices while coding.

To add Adapty documentation to Cursor:

  1. In Cursor, go to Settings > Cursor settings. Switch to Indexing & Docs.
  2. Click Add doc.
  3. Enter the URL https://adapty.io/docs.
  4. Name the documentation Adapty Docs and click Confirm to save it.
adapty-cursor.webp

Add Adapty SDKs to Cursor

For platform-specific development, we recommend adding the GitHub repository for the Adapty iOS SDK. This gives you access to the latest code examples, changelogs, and implementation details.

Follow the same process as above, but use the SDK repository URL:

  • iOS SDK: https://github.com/adaptyteam/AdaptySDK-iOS

Name the doc Adapty iOS SDK.

Reference Adapty in your prompts

Once configured, you can reference Adapty documentation and SDKs using the @ symbol in Cursor prompts. This makes sure Cursor uses current and accurate information when generating code.

Example prompts:

  • @Adapty Docs help me install the Adapty SDK
  • @Adapty iOS SDK show me how to handle purchase restoration with proper error handling
  • @Adapty Docs @Adapty iOS SDK help me show a paywall created in the paywall builder