Open customer messages on macOS
Present native support conversations inside your registered Mac app window.
Open support inside your app
Enable .messenger, identify the customer, and
register a host window before
presenting. Connect your Support button or menu command to presentSupport().
@MainActor
func openSupport() {
let result = BTX.messenger.presentSupport()
if case .failed(let reason) = result {
// Report the failure through your app's error UI.
print(reason)
}
}The native support surface shows conversation history and replies inside the host
window. Customers can send text and images, preview attachments, and react to
messages. BTX.messenger.present() also opens conversation history.
Open a conversation
Use a conversation ID belonging to the active customer's project and client.
@MainActor
func openConversation(id: String) {
BTX.messenger.presentThread(id: id)
}Call BTX.messenger.dismiss() to close the presented SDK surface.
Handle presentation results
Presentation returns .presented or .failed(...). Handle .notConfigured,
.featureDisabled, .notIdentified, and .unavailable through your app's normal
error UI. An unavailable result can mean that no registered host window can present
the surface.
Receiving replies while the app is active does not require APNs. Add push notifications for replies while the app is inactive.