Paydirt iOS SDK

Voice AI feedback for subscription apps

Recommended

Install with a Coding Agent

Open your iOS project in Codex or Claude Code and describe the outcome. The agent inspects the project, creates both trial and paid cancellation forms by default, installs the matching subscription integration, connects Slack, creates a new #paydirt-cancellation-feedback channel, edits the app, and builds the real target.

Install Paydirt in this iOS app for regular feedback, trial cancellation,
and subscription cancellation.
Detect RevenueCat, Superwall, StoreKit, or an app-owned cancellation flow.
Preserve my existing feedback form and its behavior. Connect every Paydirt form
to my Slack feedback channel, edit the app, build it, and give me an exact test path.

Codex: codex mcp add paydirt -- npx -y paydirt-mcp@latest

Claude Code: claude mcp add paydirt -- npx -y paydirt-mcp@latest

Normally, the agent discovers and follows the machine-readable installation contract itself. The commands above are a manual fallback when the MCP is not registered.

Installation

Add Paydirt to your iOS app using Swift Package Manager:

Package URL:

https://github.com/Paydirt-AI/paydirt-ios

Option 1: In Xcode

  1. File → Add Package Dependencies
  2. Paste the URL above
  3. Click Add Package

Option 2: In Package.swift

dependencies: [
    .package(url: "https://github.com/Paydirt-AI/paydirt-ios", from: "2.0.0")
]

Requirements

  • iOS 15.0+
  • Swift 5.9+
  • Xcode 15+

Info.plist

Add microphone permission for voice feedback:

<key>NSMicrophoneUsageDescription</key>
<string>Used to record voice feedback</string>

Quick Start

Initialize Paydirt in your app:

import Paydirt

// In your App init or AppDelegate
Paydirt.configure(apiKey: "your_api_key", theme: .automatic)

// Optional native StoreKit cancellation detection
Paydirt.enableStoreKitIntegration(
    productIds: ["pro.monthly", "pro.yearly"],
    cancellationFormId: "subscription-cancellation-form-id",
    trialCancellationFormId: "trial-cancellation-form-id"
)

Subscription Integrations

Paydirt supports native StoreKit, RevenueCat, Superwall, and app-owned cancellation events. Trial and paid cancellations route to separate forms.

The Paydirt core has no RevenueCat or Superwall package dependency, so it does not disturb the app's existing purchase packages or versions. The coding-agent setup contract selects and installs the correct adapter.

An older RevenueCat version is not a blocker. The agent keeps it and adapts the copied source adapter to the APIs already compiling in the app; it does not upgrade RevenueCat solely for Paydirt.

import Paydirt

Paydirt.configure(apiKey: "your-paydirt-key", theme: .automatic)
Paydirt.enableStoreKitIntegration(
    productIds: ["pro.monthly", "pro.yearly"],
    cancellationFormId: "subscription-cancellation-form-id",
    trialCancellationFormId: "trial-cancellation-form-id"
)

// RevenueCat and Superwall apps use the adapter returned by paydirt_finish_setup.

Manual Form Display

Show a form from any button, screen, or successful in-app action:

// Present a specific form by ID
Paydirt.shared.presentForm(
    formId: "your-form-id",
    userId: "user-123",           // optional
    metadata: ["paydirt_placement": "after_successful_export"],
    onCompletion: { completed in
        print("Form completed: \(completed)")
    }
)

You can ask your coding agent: “Add a feedback form titled Export Feedback after a successful export.” It creates or reuses the form, edits that exact placement, assigns Slack, builds, and returns a test path.

Structured Results

Use the optional submission callback when your app needs the response ID, transcript, and metadata for an agent or internal workflow.

Paydirt.presentForm(
    formId: "your-form-id",
    userId: "user-123",
    metadata: ["plan": "pro"],
    onSubmission: { result in
        print(result.responseId)
        print(result.messages)
    },
    onCompletion: { completed in
        print("Completed: \(completed)")
    }
)

Paydirt saves an encrypted snapshot after every accepted turn. A stable response ID and monotonic snapshot version prevent duplicate responses and stale retries.

Privacy and Reliability

  • Voice recording requires an explicit disclosure before capture.
  • Recordings stop after two minutes and use a protected temporary file.
  • Local recordings are deleted after transcription succeeds or fails.
  • Pending feedback is encrypted with a Keychain-backed key.
  • Retry delivery is idempotent and reuses the same response ID.
  • Paydirt 2.0.0 bundles its own Apple privacy manifest.
  • Agent-created apps bind their public SDK key to the discovered bundle ID.

Presentation

Paydirt follows the system appearance by default. Use a preset or pass a custom PaydirtTheme to match your app.

Paydirt.configure(apiKey: "your-api-key", theme: .automatic)

// Or choose a fixed preset at runtime
Paydirt.setTheme(.dark)

let formView = Paydirt.showForm(
    formId: "your-form-id",
    userId: "user-123"
)

Get Your API Key

  1. Sign up at paydirt.ai
  2. Create an app in the dashboard
  3. Copy your API key from App Settings
  4. Create a cancellation form

Features

  • Voice feedback - Users can speak their feedback
  • AI follow-ups - Intelligent conversational questions
  • Subscription integrations - Native StoreKit, RevenueCat, Superwall, and custom events
  • Agent-controlled placement - Add a named form to a button, screen, action, or custom condition
  • Slack notifications - Get feedback in real-time
  • Durable turns - Encrypted local and remote snapshots after every accepted answer
  • Raw Slack delivery - One final message with every Q/A and optional summary at the bottom
  • Remote form control - Enable/disable forms without app updates