Chat
A Help button in your app opens a conversation with you. The message arrives in the dashboard with that person’s journey beside it — the screens they saw, what failed, where they came from — so you answer knowing what happened. Nobody signs in to use it.
Add the chat screen
Badge your own Help button with the unread count, and present chatView() when it is tapped:
// bring the unread count up to date when the app comes forward
Astronaut.shared.refreshChat()
// ...and present the conversation when Help is tapped
.sheet(isPresented: $showingHelp) {
Astronaut.shared.chatView(
tint: .orange,
placeholder: "Ask us anything…",
// which screen sent them looking for help
source: "paywall"
)
}Astronaut.shared.unreadChatCountis what to badge. The screen takes your app’s font, background and a single tint, so it belongs without any styling to do. Opening it is recorded on the journey, with the source you passed.
Who it comes from
Set the name and role under the app’s Settings → Chat replies come from. “Sahil, Founder” reads differently from “Support”. It is shown above the conversation and on the notification, which carries your app’s name rather than astronaut’s.
Replies
Answer from the Chat tab in the dashboard. Replies are pushed to the device if you have uploaded APNs credentials, and are waiting in the conversation either way. A tap on one opens the chat; if your app presents it some other way, watch chat.shouldPresent and call chat.presentationHandled() once you have.
Writing first
You do not have to wait to be written to. Open anyone’s journey in the dashboard and start a conversation — about the export that failed twice, the paywall they bounced off, the trial ending on Friday. If their notifications are off, it is there the next time they open the chat.
Builds
Every conversation carries the build it started in, so TestFlight questions and App Store questions stay apart. The Chat tab follows the environment picked in the navbar.