iOS
A Swift package with native SwiftUI screens and UIKit presentation. iOS 17+, Xcode 15.3+ (Swift 5.10+).
Install#
In Xcode choose File → Add Package Dependencies and enter the repository URL, or add it to Package.swift:
Package.swift
CocoaPods is also supported: pod 'Parley', :git => 'https://github.com/nathancjohnson248-glitch/parley', :tag => '0.1.0'.
Configure#
Configure once at launch with the public key from Applications → Install.
Show support#
The support screen lists the customer's conversations, opens the current one, and handles sending, photo and file attachments, live updates and offline retries.
Identify users#
| Name | Type | Description |
|---|---|---|
| Parley.configure(appKey:options:) | func | Call once at launch. |
| Parley.identify(userId:email:name:avatarURL:userHash:attributes:) | async throws | Attach the session to your user. |
| Parley.updateCustomer(email:name:attributes:) | async throws | Update details without re-identifying. |
| Parley.track(_:properties:) | async throws | Record an event on the customer. |
| Parley.logout() | async | End the session and start a new anonymous one. |
| Parley.presentSupport(from:) | @MainActor | UIKit presentation. |
| View.parleySupport(isPresented:) | modifier | SwiftUI sheet presentation. |
| Parley.state.unreadCount | Int (published) | Unread replies, for badges. |
Unread badge#
Appearance
See Appearance & text for colors, corner radius, fonts and custom strings.
Push notifications
See Push notifications to register the device token and open conversations from a notification.
The core networking layer (
ParleyCore) has no UIKit dependency and is covered by unit tests that run with swift test. The SwiftUI and UIKit layers require an Apple platform build.