Skip to Main Content

iOS and macOS SDK Documentation

Native SwiftUI components for collecting feature requests directly in your iOS or Mac app. Use the same Swift package on both platforms.

Installation

Swift Package Manager

Add FeaturePortal to your project using Xcode:

  1. Open your project in Xcode
  2. Go to File → Add Package Dependencies...
  3. Enter the repository URL: https://github.com/FeaturePortal/FeaturePortal
  4. Select the latest release (macOS support requires version 1.1.0 or later)
  5. Click Add Package

Requirements

  • iOS 17.0 or later, or macOS 14.0 or later
  • Xcode 15.0 or later
  • Swift 5.9 or later

Configuration

1. Get Your API Key

  1. Log in to your FeaturePortal dashboard
  2. Create a new project or select an existing one
  3. Go to the Settings tab
  4. Copy your API key from the API Configuration section

2. Initialize the SDK

Configure FeaturePortal in your app's initializer with your API key:

MyApp.swift
import SwiftUI
import FeaturePortal

@main
struct MyApp: App {
    init() {
        FeaturePortal.configure(
            apiKey: "your_api_key_here"
        )
    }

    var body: some Scene {
        WindowGroup {
            ContentView()
        }
    }
}
⚠️
Security note
Never commit your API key to version control. Consider using environment variables or a configuration file that's excluded from git.

Components

FeatureListView

A complete feature request board that displays all features with voting and commenting capabilities.

ContentView.swift
import SwiftUI
import FeaturePortal

struct ContentView: View {
    var body: some View {
        FeaturePortal.FeatureListView()
    }
}

The FeatureListView automatically:

  • Fetches features from your project
  • Displays voting counts and allows users to upvote
  • Shows comments and enables users to add new ones
  • Supports dark mode automatically
  • Supports pull-to-refresh on iOS and a Refresh toolbar button on macOS
  • Handles loading and error states

Built-in Navigation

FeatureListView includes Requests and Roadmap tabs on iOS and a segmented control on macOS, each with its own navigation. Embed it directly in your app:

FeaturePortal.FeatureListView()

macOS window integration

Add a dedicated feedback window to your Mac app. Configure FeaturePortal in your app initializer as shown above, then add this scene alongside your existing app windows:

Window("Feature Requests", id: "feature-requests") {
    FeaturePortal.FeatureListView()
}

The macOS view includes window toolbar actions for Refresh (⌘R) and New Feature Request (⌘N), plus layouts sized for Mac windows and sheets.

Tab bar integration

Add a dedicated tab for feature requests:

TabView {
    HomeView()
        .tabItem {
            Label("Home", systemImage: "house")
        }

    FeaturePortal.FeatureListView()
        .tabItem {
            Label("Feedback", systemImage: "lightbulb")
        }

    SettingsView()
        .tabItem {
            Label("Settings", systemImage: "gear")
        }
}

Customization

Theme support

FeaturePortal automatically adapts to your app's appearance mode (light/dark). No additional configuration required!

User identity

The SDK creates an anonymous app-user identity and stores its identifier on the device. Voting and comments use this identity without requiring your users to create a FeaturePortal account.

View Tracking (Analytics)

The built-in feature detail view records views automatically. These events power view counts and trends in your project’s Analytics tab; no extra tracking call is needed.

📊
Analytics dashboard
View tracking data is automatically aggregated in your project's Analytics tab, showing most viewed features, view trends, and source breakdowns.

View tracking runs in the background and does not block the interface if a request fails. When available, the event includes the anonymous app-user identifier. The Swift SDK currently sends the source ios on both iOS and macOS, so Mac views are included in that source rather than shown separately.

For a custom integration outside the built-in views, see the REST API view-tracking documentation.

Best practices

✓
Make it Easy to Find
Add a dedicated tab or menu item for feature requests so users can easily submit feedback.
✓
Respond to feedback
Use the dashboard to update feature statuses and post comments. Users see the latest state when the SDK refreshes.
✓
Share your roadmap
Link to your public roadmap in app settings or about page to show users what's coming.
✓
Engage early
Introduce feature requests during onboarding to build a feedback culture from day one.

Troubleshooting

"Invalid API Key" Error

  • Verify you copied the entire API key from the dashboard
  • Check there are no extra spaces or line breaks
  • Ensure you're using the correct project's API key
  • Try regenerating the API key in project settings

Features not loading

  • Check your internet connection
  • Verify the API key is configured correctly
  • Look for errors in the Xcode console
  • Try pull-to-refresh in the feature list

Getting help

Need additional help? Here's how to get support:

💡
Example project
Check out the example app in the GitHub repository to see FeaturePortal in action with complete implementation examples.