promoted-iap

Generates Promoted In-App Purchase setup with StoreKit 2 product configuration, paywall integration, and App Store product page display. Use when setting up promoted purchases that appear on the App Store product page.

149 stars

Best use case

promoted-iap is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Generates Promoted In-App Purchase setup with StoreKit 2 product configuration, paywall integration, and App Store product page display. Use when setting up promoted purchases that appear on the App Store product page.

Teams using promoted-iap should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/promoted-iap/SKILL.md --create-dirs "https://raw.githubusercontent.com/rshankras/claude-code-apple-skills/main/skills/generators/promoted-iap/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/promoted-iap/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How promoted-iap Compares

Feature / Agentpromoted-iapStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Generates Promoted In-App Purchase setup with StoreKit 2 product configuration, paywall integration, and App Store product page display. Use when setting up promoted purchases that appear on the App Store product page.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# Promoted In-App Purchases Generator

Set up promoted In-App Purchases so your premium offerings appear directly on your App Store product page, in search results, and in editorial features.

## When This Skill Activates

Use this skill when the user:
- Asks to "promote IAP" or "show purchase on product page"
- Mentions "promoted in-app purchase" or "App Store product page IAP"
- Wants subscription/IAP visible in App Store search results
- Asks about `paymentQueue(_:shouldAddStorePayment:for:)`
- Wants to handle purchases initiated from the App Store

## Pre-Generation Checks

### 1. Project Context Detection
- [ ] Check for existing StoreKit implementation
- [ ] Check deployment target (iOS 15+ for StoreKit 2)
- [ ] Look for existing IAP product definitions
- [ ] Check if `paywall-generator` was already used

### 2. Conflict Detection
```
Glob: **/*Promoted*.swift, **/*StorePayment*.swift
Grep: "shouldAddStorePayment" or "PurchaseIntent" or "promotedPurchase"
```

## How Promoted IAP Works

1. **App Store Connect**: Mark IAP products as "Promoted" with promotional image
2. **Product Page**: Up to 20 promoted IAPs appear on your product page
3. **Search Results**: Promoted IAPs can appear in search
4. **User Action**: User taps "Buy" on App Store → your app opens to complete purchase
5. **Your App**: Must handle the incoming purchase intent

### Promoted IAP Display Order
- You control the order in App Store Connect
- Choose your most compelling IAP as the first promoted product
- Apple may also feature your IAPs in editorial content

## Configuration Questions

Ask user via AskUserQuestion:

1. **What type of IAP to promote?**
   - Auto-renewable subscription
   - Non-consumable (one-time unlock)
   - Consumable (credits/tokens)

2. **How to handle App Store-initiated purchases?**
   - Show immediately (direct purchase)
   - Show paywall first (let user see options before buying)
   - Show onboarding then purchase (new users from App Store)

3. **Number of promoted products?**
   - Single product
   - Multiple products (2-5)
   - Full catalog (6+)

## Generation Process

### Step 1: Read Templates
Read `templates.md` for promoted IAP implementation code.

### Step 2: Create Core Files

1. **PromotedPurchaseHandler.swift** — Handle purchases initiated from App Store
2. **PromotedProductConfiguration.swift** — Product definitions and promotional images specs
3. **PromotedPurchaseFlowView.swift** — UI for completing promoted purchases in-app

### Step 3: Determine File Location
```
- If Sources/Store/ exists → Sources/Store/Promoted/
- If Store/ exists → Store/Promoted/
- Otherwise → Store/Promoted/
```

## Output Format

### Files Created
```
Store/Promoted/
├── PromotedPurchaseHandler.swift        # App Store purchase handling
├── PromotedProductConfiguration.swift   # Product setup & image specs
└── PromotedPurchaseFlowView.swift       # In-app purchase completion UI
```

### Integration Steps

**Handle App Store-Initiated Purchases (StoreKit 2):**
```swift
@main
struct MyApp: App {
    var body: some Scene {
        WindowGroup {
            ContentView()
                .task {
                    // Listen for purchases initiated from App Store
                    for await purchaseIntent in PurchaseIntent.intents {
                        await PromotedPurchaseHandler.shared.handle(purchaseIntent)
                    }
                }
        }
    }
}
```

**Complete the Purchase:**
```swift
// PromotedPurchaseHandler determines the right flow:
// 1. Direct purchase (existing user, known product)
// 2. Paywall (show options first)
// 3. Onboarding (new user from App Store)
```

### App Store Connect Setup

1. Go to App Store Connect > Your App > In-App Purchases
2. Select the IAP product
3. Under "App Store Promotion":
   - Upload promotional image (1024x1024, no alpha, no rounded corners)
   - Set display order
   - Enable promotion
4. Repeat for each product you want to promote

### Promotional Image Requirements
- **Size**: 1024 x 1024 pixels
- **Format**: PNG or JPEG, no transparency
- **Content**: Feature the product value, not just the app icon
- **Text**: Minimal — the product name appears separately
- **Style**: Match your app's visual identity

### Testing Instructions

1. **StoreKit Configuration**: Add promoted products to your .storekit file
2. **Test purchase flow**: Simulate App Store-initiated purchase
3. **Test user states**: New user, existing free user, existing subscriber
4. **Verify UI**: Purchase completion view looks correct for each product type

## References

- **templates.md** — Production Swift templates
- Related: `generators/paywall-generator` — Full paywall for purchase completion
- Related: `generators/subscription-offers` — Offer types for promoted subscriptions
- Related: `app-store/marketing-strategy` — Strategic product promotion planning

Related Skills

watchOS

149
from rshankras/claude-code-apple-skills

watchOS development guidance including SwiftUI for Watch, Watch Connectivity, complications, and watch-specific UI patterns. Use for watchOS code review, best practices, or Watch app development.

visionos-widgets

149
from rshankras/claude-code-apple-skills

visionOS widget patterns including mounting styles, glass/paper textures, proximity-aware layouts, and spatial widget families. Use when creating or adapting widgets for visionOS.

test-data-factory

149
from rshankras/claude-code-apple-skills

Generate test fixture factories for your models. Builder pattern and static factories for zero-boilerplate test data. Use when tests need sample data setup.

test-contract

149
from rshankras/claude-code-apple-skills

Generate protocol/interface test suites that any implementation must pass. Define the contract once, test every implementation. Use when designing protocols or swapping implementations.

tdd-refactor-guard

149
from rshankras/claude-code-apple-skills

Pre-refactor safety checklist. Verifies test coverage exists before AI modifies existing code. Use before asking AI to refactor anything.

tdd-feature

149
from rshankras/claude-code-apple-skills

Red-green-refactor scaffold for building new features with TDD. Write failing tests first, then implement to pass. Use when building new features test-first.

tdd-bug-fix

149
from rshankras/claude-code-apple-skills

Fix bugs using red-green-refactor — reproduce the bug as a failing test first, then fix it. Use when fixing bugs to ensure they never regress.

snapshot-test-setup

149
from rshankras/claude-code-apple-skills

Set up SwiftUI visual regression testing with swift-snapshot-testing. Generates snapshot test boilerplate and CI configuration. Use for UI regression prevention.

integration-test-scaffold

149
from rshankras/claude-code-apple-skills

Generate cross-module test harness with mock servers, in-memory stores, and test configuration. Use when testing networking + persistence + business logic together.

characterization-test-generator

149
from rshankras/claude-code-apple-skills

Generates tests that capture current behavior of existing code before refactoring. Use when you need a safety net before AI-assisted refactoring or modifying legacy code.

testing

149
from rshankras/claude-code-apple-skills

TDD and testing skills for iOS/macOS apps. Covers characterization tests, TDD workflows, test contracts, snapshot tests, and test infrastructure. Use for test-driven development, adding tests to existing code, or building test infrastructure.

webkit-integration

149
from rshankras/claude-code-apple-skills

WebKit integration in SwiftUI using WebView and WebPage for embedding web content, navigation, JavaScript interop, and customization. Use when embedding web content in SwiftUI apps.