Overview
This guide takes you from nothing to a working support chat in your SwiftUI app: users message your team from inside the app, you answer from the dashboard, and they see your reply live, or get a push notification if they've left the chat.
You'll need:
- A SeggWat project on the Pro plan (chat is a Pro feature)
- An iOS app on iOS 16+ with the iOS SDK 1.3.0 or later (1.4.0 for quoted replies)
- An Apple Developer account, if you want push notifications or App Attest
In a hurry? Settings → Widget Defaults has a ready-made prompt for Claude Code, Cursor or similar tools that adds the SDK, chat and push to your app. See Set up with an AI coding assistant.
1. Pick how users are identified
Every conversation belongs to one identity. Choose before you write any code:
| Signed tokens | Anonymous | |
|---|---|---|
| Best for | Apps with user accounts and a backend | Apps without accounts or a server |
| Conversation follows the user | Across devices, and shared with the web widget chat | Per install, survives app restarts |
| You know who's writing | Yes | No |
| Reply emails when they've left | Yes, if the token has an email |
No |
| Spam protection | Your backend decides who gets a token | App Attest |
If users can sign in later, you can use both: anonymous until sign-in, then a token. Signing in starts a separate conversation; the anonymous one isn't merged.
2. Turn on chat in the dashboard
Open Widget Defaults
Go to Project → Settings → Widget Defaults.
Enable Live Chat
Turn on Live Chat. This enables chat for both the web widget and the iOS SDK.
Anonymous only: allow anonymous chat
Turn on Anonymous chat in apps below the Live Chat toggle. Skip this if you use signed tokens.
For signed tokens, also set up the project's signing secret under End-User Authentication.
3. Add chat to your app
Configure the SDK as usual (see the Quickstart), then connect the chat identity.
Your backend mints a short-lived token for the signed-in user, signed with the project's signing secret (claims and signing). Hand it to the SDK after sign-in and clear it on sign-out:
// After sign-in
SeggWat.setChatToken(tokenFromYourBackend)
// On sign-out
SeggWat.setChatToken(nil)That's enough for users to start chatting: the feedback form now shows a Chat with us button.
Open the chat from your own UI
To add a "Contact support" row or similar:
SeggWat.presentChat()The floating feedback button already shows an unread count. For your own badge, observe SeggWat.shared.unreadCount. It refreshes every minute in the foreground; call await SeggWat.shared.refreshUnreadCount() to update it right away.
4. Block spam (anonymous only)
Without checks, anyone can script anonymous conversations into your inbox. App Attest makes SeggWat accept only genuine installs of your app on real devices.
Enter your Team ID
Below the anonymous chat toggle, enter your Apple Team ID (Apple Developer account → Membership details).
Check your bundle ID
Make sure your app's bundle ID is in Allowed Bundle IDs.
Add the capability
In Xcode, add App Attest under Signing & Capabilities. No code changes: the SDK attests on its own, once per install.
The iOS Simulator can't use App Attest, so chat fails there while a Team ID is set. Leave the field empty while testing in the Simulator and set it before you ship.
5. Add push notifications
Without push, users only see your reply when they next open the app (or by email, with signed tokens). With push, their iPhone gets a notification from your app about 10 seconds after you reply, unless they've already read it in the open chat. Tapping it opens the conversation.
Create an APNs key
In your Apple Developer account, under Certificates, Identifiers & Profiles → Keys, create a key with Apple Push Notifications service (APNs) enabled and download the .p8 file. Keep the environment at Sandbox & Production.
Upload it to SeggWat
In Widget Defaults, the iOS app: push notifications card asks for your Team ID, Key ID, bundle ID and the .p8 file. Click Turn on push; SeggWat checks the key with Apple before saving.
Wire up your app
Add the Push Notifications capability, call SeggWat.enablePushNotifications(), and pass the device token and notification taps to the SDK with SeggWat.setPushToken(_:) and SeggWat.handleNotification(_:). The full AppDelegate code is in Wire up your app.
Don't ask for notification permission yourself: the SDK asks after the user's first chat message, when they have a reason to say yes.
6. Test it end to end
- Run the app on a real iPhone (the Simulator usually can't get a push token).
- Open the chat and send a message. Allow notifications when asked.
- In the dashboard, open Messages → Live chat. The message is there and your team got an in-app notification.
- Reply. With the chat still open, the reply appears live.
- Close the chat or background the app and reply again. About 10 seconds later the push arrives; tap it to land in the conversation.
- Push not arriving? Use Send test push on the push card. It targets the most recently registered device and shows Apple's error if delivery fails.
Answering conversations
Conversations land in Messages → Live chat in the dashboard, with items waiting on you first.
- Quote a message: replies you quote show the quoted message above your reply in the app. Users can quote too, by long-pressing a message.
- On the go: the SeggWat triage app shows conversations and can send quoted replies.
- Turn a chat into work: create a feedback item (with the transcript attached) or an idea on your board from any conversation, attributed to the user.
- Track response times: the Chat tab in Insights shows conversation volume, median first-response time and what's awaiting a reply.
- Automate: the API can list the inbox and post team replies, including an optional
reply_to_idto quote a message.
Troubleshooting
| Symptom | Likely cause |
|---|---|
| No Chat with us button | Live Chat is off, the project isn't on Pro, or no identity is set (setChatToken / enableAnonymousChat) |
| Anonymous chat fails in the Simulator | A Team ID is set, so App Attest is required. Clear it while testing |
| Anonymous chat fails on a device | Bundle ID missing from Allowed Bundle IDs, or the App Attest capability isn't added |
| No push after a reply | The user was watching the chat (no push needed), the APNs key is limited to one environment, or the app never called setPushToken |
| Old conversation after sign-out | Call setChatToken(nil) on sign-out |
Next Steps
- iOS SDK reference: every chat and push option in detail
- Live chat in the web widget: the same conversation on your website
- End-User Authentication: signing tokens for identified users
