Skip to main content

Feedback

Feedback is an in-app chat your users can write to, and you answer from the Bugsee dashboard. In 7.x it ships as a separate Swift package, BugseeFeedback, on top of the core SDK: apps that do not use it do not carry it.

Install the package​

Add https://github.com/bugsee/feedback-spm next to the core package, at exactly the same version as Bugsee. Each BugseeFeedback release is published together with the core release of the same version and requires exactly that version, so when you upgrade, change both together.

dependencies: [
.package(url: "https://github.com/bugsee/spm", exact: "7.1.0"),
.package(url: "https://github.com/bugsee/feedback-spm", exact: "7.1.0"),
],
targets: [
.target(
name: "YourApp",
dependencies: [
.product(name: "Bugsee", package: "spm"),
// The package identity is "feedback-spm".
.product(name: "BugseeFeedback", package: "feedback-spm"),
]
),
]

In Xcode, choose File → Add Package Dependencies…, paste the URL and set the rule to Exact Version. BugseeFeedback requires iOS 15 or later, like the core SDK.

Register before launch​

The package registers itself with the SDK when it is loaded. That automatic registration is best effort — a static link without -ObjC can strip it — so also register it explicitly; doing both is harmless. Register it before launchWithToken:.

@import Bugsee;
@import BugseeFeedback;

[BugseeFeedback register];
[Bugsee launchWithToken:@"<your_app_token>"];

Show the chat​

Present the chat wherever it fits your app — a settings screen, a support button:

[[BugseeFeedback shared] showFeedbackUI];

The chat is presented modally over the top view controller of the key window, and can be called from any thread.

The first time, the chat asks the user for an email address, which they can skip. The screen is not shown again once it has been shown — also when it was shown by a 6.x version of the app — and it is skipped when the user identifier contains @. Messages are sent with the email the user gave, or else with the user identifier.

While the chat is on screen it checks for new messages every 10 seconds; while it is closed, nothing is fetched. The conversation is cached on the device. A message that could not be sent is retried the next time Bugsee is launched.

Default greeting​

The greeting is set in your application settings on the server. Set one on the client too, for when the network is not available:

[[BugseeFeedback shared] setGreeting:@"Hi! How can we help?"];

New-message callbacks​

To find out when messages arrive or are sent, set a listener that conforms to BugseeFeedbackListener. New messages are fetched only while the chat is on screen, so onNewMessagesReceived: is called only then: it cannot drive a badge for replies that arrive while the chat is closed.

@interface SupportBadge : NSObject <BugseeFeedbackListener>
@end

@implementation SupportBadge

- (void)onNewMessagesReceived:(NSArray<NSString *> *)messages {
// New messages from your team
}

- (void)onNewMessageSent:(NSString *)message {
// The user's message was delivered
}

@end

// Keep a strong reference to the listener
[[BugseeFeedback shared] setListener:self.supportBadge];
  • Both callbacks are called on the main thread.
  • The listener is held weakly: keep it alive yourself. Pass nil to remove it.

Accessing the add-on through the SDK​

The add-on is also reachable through the core SDK's extension registry, as a BugseeFeedbackExtension, which declares showFeedbackUI, setGreeting: and setListener::

id<BugseeFeedbackExtension> feedback = [Bugsee ext:[BugseeFeedback class]];
[feedback showFeedbackUI];

Appearance​

The chat and its email screen read five colors from +[Bugsee getAppearance]: feedbackBackgroundColor, feedbackEmailBackgroundColor, feedbackEmailContinueActiveColor, feedbackEmailContinueNotActiveColor and feedbackEmailSkipColor. The other feedback… properties of BugseeTheme are not applied. See Appearance.

Privacy​

The package carries its own privacy manifest. It declares the data the chat collects: the messages the user types (customer support), their email address and their user ID.

Migrating from 6.x​

6.x7.x
+[Bugsee showFeedbackController][BugseeFeedback.shared showFeedbackUI]
+[Bugsee setDefaultFeedbackGreeting:][BugseeFeedback.shared setGreeting:]
-[BugseeDelegate bugsee:didReceiveNewFeedback:]-[BugseeFeedbackListener onNewMessagesReceived:] (called only while the chat is on screen)
(not available)-[BugseeFeedbackListener onNewMessageSent:]

See the migration guide.

Found an issue, typo, or wrong statement on this page? Report it now →