Skip to content

Adding a user feedback form to an iOS app

Setup

Step 1: Add FeedbackBulb as a dependency

Using the Swift Package Manager, add a reference to the FeedbackBulb library:

  • GitHub: https://github.com/Headbright/feedbackbulb-swift

The library contains two targets depending on whether you wish to use one of our feedback form templates or you'd rather create your own. To get both options, use the FeedbackBulb.Toolbox target.

Step 2: Integrate the feedback widget

In SwiftUI, create a wrapper view to hold the logic for displaying and dismissing the feedback widget. It's all just regular SwiftUI code except for SimpleFeedbackForm which comes from the FeedbackBulb.Toolbox:

swift
struct PresentingSheetView: View {
  @Environment(\.dismiss) private var dismiss
  var body: some View {
    NavigationStack {
        //TODO: - Replace with your API key
        SimpleFeedbackForm(appKey: "XX-XXX-XXXX")
        .toolbar {
          ToolbarItem(placement: .cancellationAction) {
            Button("Dismiss", action: {dismiss()})
          }
        }
    }
  }
}

You can retrieve your app key from the FeedbackBulb app dashboard

In your app, when needed, display the feedback widget as a sheet:

swift
...
.sheet(isPresented: $showFeedback,
           content: { PresentingSheetView() })

Step 3:

There is no step 3 😉

Configure the widget

The widget allows several configuration options to be changed with the aid of SimpleFeedbackConfig. You can show or hide different components or change the text labels.

  • title - String, defaults to "Send feedback",

  • subtitle - String, defaults to "We'd love to hear from you",

  • textLabel - String, defaults to "Describe what's happening",

  • textDescription - String, defaults to "Remember not to include personal information.",

  • textAccessibilityLabel - String, defaults to "Enter feedback",

  • submitButtonLabel - String, defaults to "Submit",

  • showEmail - Bool, defaults to false,

  • emailLabel - String, defaults to "Email",

  • emailPlaceholder - String, defaults to "Type your email address",

  • debugRequests - Bool, defaults to true,

  • showAddImage - Bool, defaults to true,

  • addImageLabel - String, defaults to "Include a screenshot"

  • showEmojiPicker - Bool, defaults to false,

  • emojiPickerLabel - String, defaults to "How do you feel about this app?"

  • emojis - [String], defaults to ["😁", "🤔", "🥵", "🙁", "🤘", "🚀", "🤯", "🎉", "🔥", "🙌"],

  • pinSubmitButton - Bool, defaults to false

Example usage:

swift
SimpleFeedbackForm(appKey: "XX-XXX-XXXX",
                   config: .init(title: "Hello",
                   subtitle: "How do you feel about our app?",
                   textDescription: "",
                   showEmail: true)
)

Notes

The swift package contains the followin targets available to be adopted as dependencies within your app:

  • FeedbackBulb.Toolbox - A collection of feedback components ready to use in your app. Use this option to get started quickly using one of the production-ready designs developed by FeedbackBulb.

  • FeedbackBulb - base API client for the FeedbackBulb API allowing you to manually submit feedback values. Use this options if you prefer to build your own UI experience for collecting feedback.

Supported platforms

The FeedbackBulb Toolbox is available for the following targets:

  • iOS, iPadOS 15.5 or later
  • Mac Catalyst 16 or later

Preview

Feedbackbulb supports both a custom UI provided by you or one of our built-in started layouts. Here's a preview of the SimpleFeedbackForm we provide out of the box:

Preview of feedback widgetPreview of feedback widget

🚧 Work in progress