Enjoying the docs? Start building free, no credit card needed. Get started →
Docs / iOS (SwiftUI)

Mobile

iOS (SwiftUI)

Add a native feature request board to your iPhone app. It takes three steps.

Needs iOS 17 or later and Swift 5.9 or later. No other packages needed.

Install

  1. Add the package in Xcode

    In Xcode, open File → Add Package Dependencies… and paste this URL:

    https://github.com/fewchurs/fewchurs-swift

    Keep the rule Up to Next Major Version and pick 2.0.0 or later.

  2. Or add it to Package.swift

    If your project uses a Package.swift file, add this line instead:

    Package.swift
    dependencies: [    .package(url: "https://github.com/fewchurs/fewchurs-swift", from: "2.0.0")]

Set up

Call configure once, when your app starts. Use the API key from your dashboard.

MyApp.swift
import SwiftUIimport Fewchurs@mainstruct MyApp: App {    init() {        Fewchurs.configure(apiKey: "fr_live_xxx")    }    var body: some Scene {        WindowGroup {            ContentView()        }    }}

Show the board

FeatureRequestBoardView is a normal SwiftUI view. Show it in a sheet, a tab, or push it onto a navigation stack. It handles everything inside: the list, votes, comments and new requests.

SettingsView.swift
import SwiftUIimport Fewchursstruct SettingsView: View {    @State private var showBoard = false    var body: some View {        Button("Suggest a feature") {            showBoard = true        }        .sheet(isPresented: $showBoard) {            FeatureRequestBoardView()        }    }}

Using UIKit

Wrap the board in a UIHostingController and present it from any view controller.

import UIKitimport SwiftUIimport Fewchurslet board = UIHostingController(rootView: FeatureRequestBoardView())present(board, animated: true)

Colors and theme

By default the board follows your app: system colors, your accent color, and light or dark mode. To change it, pass a theme to configure.

// A built-in dark themeFewchurs.configure(apiKey: "fr_live_xxx", theme: .midnight)// Or your own colorslet theme = FeatureRequestTheme(    background: Color(.systemBackground),    accent: .orange,    cornerRadius: 16)Fewchurs.configure(apiKey: "fr_live_xxx", theme: theme)
ThemeWhat it looks like
.systemDefault. Follows the phone's light or dark mode.
.midnightAlways dark, black and white.
FeatureRequestTheme(…)Your own background, accent color and corner radius.

About the API key

It's fine to put this key in your app. It can only do what the board does: list, vote, comment and suggest. It can't change your settings or read anything private.

The key only works in the apps you added in the dashboard. Your Bundle ID is in Xcode under your target → General. See find your app IDs.

The SDK gives each device a random ID and keeps it in the Keychain. That is how it remembers votes without an account. Read more in How it works.

Key not working

The SDK sends your app's Bundle ID with every request. If that Bundle ID isn't added to your app in the dashboard, Fewchurs refuses the request.

WhoWhat they see
Your users"This app's API key is invalid. Please contact the developer."
You, in Debug buildsThe board also shows which Bundle ID was refused, like "This API key is not set up for com.other.app."

To fix it, open your app's Settings in the dashboard, pick iOS and add the exact Bundle ID. It works again within a minute. You don't need a new key or a new release.

Bundle ID in the appWorks with com.yourcompany.app saved?
com.yourcompany.appYes
com.yourcompany.app.widgetYes, IDs under it work too
com.yourcompany.app.debugYes
com.yourcompany.otherNo. Add it, or use the right key
Versions before 1.2.0 don't send the Bundle ID. They still work for now, but update so your key only works in your own app.

What your plan changes

Your plan is applied on our servers, so you never need to change code or update the SDK when it changes.

FreeStarterPro
Requests the board listsFirst 5First 200All
"Powered by Fewchurs" lineShownHiddenHidden

Newer requests are still saved and show in your dashboard. A request someone just submitted appears on their board straight away, but once the app is past its limit it leaves the list on the next refresh. See pricing.