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:
- Open your project in Xcode
- Go to File → Add Package Dependencies...
- Enter the repository URL:
https://github.com/FeaturePortal/FeaturePortal - Select the latest release (macOS support requires version 1.1.0 or later)
- 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
- Log in to your FeaturePortal dashboard
- Create a new project or select an existing one
- Go to the Settings tab
- Copy your API key from the API Configuration section
2. Initialize the SDK
Configure FeaturePortal in your app's initializer with your API key:
import SwiftUI
import FeaturePortal
@main
struct MyApp: App {
init() {
FeaturePortal.configure(
apiKey: "your_api_key_here"
)
}
var body: some Scene {
WindowGroup {
ContentView()
}
}
}Components
FeatureListView
A complete feature request board that displays all features with voting and commenting capabilities.
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.
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
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:
- GitHub Issues: Report bugs or request features at github.com/FeaturePortal/FeaturePortal/issues
- Documentation: Check the README on GitHub for the latest updates
- Web Dashboard: Review the API Reference for endpoint details