Developer Guide

Swift SDK
Integration Guide

Add in-app surveys to your iOS app in under 5 minutes. Native Swift, Swift Package Manager, no external dependencies.

Quick Overview

Three steps to integrate: Add the package via Swift Package Manager, configure with your API key in App init or AppDelegate, and call the trigger method where you want surveys to appear. Prefer AI? In your FeedbackWall dashboard, go to Documentation and copy the AI prompt - paste it into Cursor or Claude and let AI do the integration for you.

Requirements

iOS 15.0+

Minimum deployment target

Swift 5.9+

Swift language version

Xcode 15+

Development environment

API Key

From FeedbackWall dashboard

1

Add the Swift Package

The FeedbackWall SDK is distributed via Swift Package Manager. No CocoaPods or Carthage needed.

In Xcode:

  1. Go to File → Add Package Dependencies
  2. Enter the repository URL:
    https://github.com/jaco110d/feedbackwall-ios-sdk
  3. Select Up to Next Major Version and click Add Package
  4. Select your app target and click Add Package

Or add to Package.swift manually:

dependencies: [
    .package(
        url: "https://github.com/jaco110d/feedbackwall-ios-sdk",
        from: "1.0.0"
    )
]
2

Configure the SDK

Initialize FeedbackWall when your app starts. You'll need your API key from the FeedbackWall dashboard.

SwiftUI App

import SwiftUI
import FeedbackWall

@main
struct MyApp: App {
    init() {
        FeedbackWall.configure(
            apiKey: "your-api-key",
            baseURL: URL(string: "https://feedbackwall.io")!
        )
    }
    
    var body: some Scene {
        WindowGroup {
            ContentView()
        }
    }
}

UIKit AppDelegate

import UIKit
import FeedbackWall

@main
class AppDelegate: UIResponder, UIApplicationDelegate {
    
    func application(
        _ application: UIApplication,
        didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
    ) -> Bool {
        
        FeedbackWall.configure(
            apiKey: "your-api-key",
            baseURL: URL(string: "https://feedbackwall.io")!
        )
        
        return true
    }
}
Find your API key: Log in to FeedbackWall → Select your app → Settings → API Key
3

Identify Users (Optional)

Associate feedback with specific users. This helps you understand who's giving feedback and follow up if needed.

// After user logs in
FeedbackWall.identify(
    userId: "user-123",
    traits: [
        "plan": "pro",
        "signupDate": "2024-01-15"
    ]
)

// On logout
FeedbackWall.reset()

User traits

Traits are optional key-value pairs that help you segment feedback. Common traits include:

  • plan - Subscription tier
  • signupDate - When they joined
  • appVersion - Which version they're using
4

Trigger Surveys

Call the trigger method at key moments in your app. The SDK will check if there's an active survey and show it.

SwiftUI

import SwiftUI
import FeedbackWall

struct OrderConfirmationView: View {
    var body: some View {
        VStack {
            Text("Order confirmed!")
            
            Button("Done") {
                // Check for and show survey at this moment
                FeedbackWall.showIfAvailable(trigger: "order_completed")
            }
        }
    }
}

UIKit

import UIKit
import FeedbackWall

class OrderConfirmationViewController: UIViewController {
    
    @IBAction func doneTapped(_ sender: Any) {
        // Check for and show survey at this moment
        FeedbackWall.showIfAvailable(trigger: "order_completed")
        
        dismiss(animated: true)
    }
}

Good trigger points:

  • After completing a purchase
  • After finishing onboarding
  • After reaching a milestone
  • After using a feature 3+ times

API Reference

FeedbackWall.configure(apiKey:baseURL:)

Initialize the SDK. Call once at app launch.

apiKey: StringYour API key from dashboard
baseURL: URLFeedbackWall backend URL

FeedbackWall.identify(userId:traits:)

Associate the current user with surveys.

userId: StringUnique user identifier
traits: [String: Any]?Optional user attributes

FeedbackWall.showIfAvailable(trigger:)

Check for and show a survey if available.

trigger: StringTrigger name from dashboard

FeedbackWall.reset()

Clear user session. Call on logout.

No parametersClears all user data

Troubleshooting

Survey not appearing

  • Check that you have an active survey in the dashboard
  • Verify the event name matches your trigger configuration
  • Enable debugMode to see console logs
  • Check sample rate settings in the dashboard

Package not found

  • Verify the repository URL is correct
  • Try File → Packages → Reset Package Caches
  • Check your network connection
  • Ensure Xcode 15 or later is installed

API key errors

  • Double-check the key in your dashboard
  • Ensure no extra spaces in the string
  • Verify baseURL doesn't have a trailing slash

Responses not appearing

  • Check the dashboard for the correct app
  • Verify network connectivity on device
  • Wait a few seconds for data to sync

Common questions

Do I need to update my app to change surveys?

No. Surveys are managed from the FeedbackWall dashboard. Create, edit, and pause surveys without any code changes or App Store updates.

What's the SDK size impact?

The SDK adds less than 200KB to your app size. It has no external dependencies and uses only native iOS frameworks.

Does it work offline?

Surveys require a network connection to load. Responses are sent immediately but will retry if offline.

Is it compatible with SwiftUI?

Yes. The SDK works with both SwiftUI and UIKit apps. Survey UI is presented modally and works in any context.

Ready to start collecting feedback?

Get your API key and integrate in under 5 minutes.

Get your API key

14-day free trial included.