Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Entry widget and secure conversations v2 #1036

Draft
wants to merge 109 commits into
base: development
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
109 commits
Select commit Hold shift + click to select a range
778dcbf
Update dependencies declared in `Podfile` and `Package.swift`
Nov 11, 2024
032cef6
Add EntryWidget UI
rasmustautsglia Sep 23, 2024
514a3cd
Add Engagement Launcher interface and getter from Glia
ykyivskyi-gl Sep 25, 2024
1ba607a
Add EntryWidget embedded view
rasmustautsglia Sep 26, 2024
7559d16
Implement EngagementLauncher logic
ykyivskyi-gl Sep 30, 2024
a3c0076
Add Unified Customization to EntryWidget
rasmustautsglia Oct 3, 2024
5ceba85
Update Entry Widget media types texts
rasmustautsglia Oct 8, 2024
55186e2
Implement QueuesMonitor to observe queues' engagement type updates
ykyivskyi-gl Oct 8, 2024
0caabc1
Add remote configuration for secure conversations
igorkravchenko Oct 11, 2024
13d6260
Integrate queues monitor and engagement launcher into EntryWidget
ykyivskyi-gl Oct 13, 2024
aa25d80
Add new localization keys and update existing for local strings for SC
igorkravchenko Oct 14, 2024
d7bdbd1
Make entry widget height dynamic
rasmustautsglia Oct 16, 2024
e824ac6
Update 'Check Messages' button and margins on SC Welcome screen
igorkravchenko Oct 15, 2024
9214e9b
Add new public interfaces to the Entry Widget
rasmustautsglia Oct 18, 2024
8463714
Cover QueuesMonitor with unit tests
ykyivskyi-gl Oct 18, 2024
980734d
Add new localizations for the Entry Widget.
AH-MOC Oct 16, 2024
6174787
Add Entry Widget Loading view design
rasmustautsglia Oct 21, 2024
28c6267
Introduce SC bottom banner UI on chat screen
igorkravchenko Oct 21, 2024
b9eff93
Implement unified customization for SC bottom banner
igorkravchenko Oct 23, 2024
60e98db
Make passed getEngagementLauncher queuesId paramater non-nullable
ykyivskyi-gl Oct 24, 2024
bdb1c27
Leave Current Conversation dialog UI
Oct 25, 2024
496dec6
Remote config for Leave Current Conversation dialog
Oct 25, 2024
3f27c81
Hide the "Secure Messaging" if visitor is not authenticated
rasmustautsglia Oct 24, 2024
8201c2f
Snapshot tests for Leave Current Conversation dialog
Oct 25, 2024
a2ad4e4
Add accessibility modifiers to the Entry Widget
AH-MOC Oct 22, 2024
063ede5
Add new send message unavailability banner
igorkravchenko Oct 24, 2024
0184147
Add unified customization for new SC unavailability indicator for chat
igorkravchenko Oct 26, 2024
09aa33b
Make EntryWidget sheet landscape adaptable
rasmustautsglia Oct 28, 2024
0e117d1
Replace unavailability dialog with banner view on Transcript screen
igorkravchenko Oct 28, 2024
06ba1fa
Toggle SC bottom banner visibility based on view model
igorkravchenko Oct 29, 2024
2275118
Use queues from QueuesMonitor to determine Secure Conversations avail…
ykyivskyi-gl Oct 30, 2024
90fa32f
Improve the Entry Widget Style structures
AH-MOC Oct 28, 2024
48aca29
Hide EntryWidget sheet before engagement
rasmustautsglia Nov 4, 2024
5b21bde
Add snapshot tests to EntryWidget
rasmustautsglia Nov 1, 2024
9eaa8a6
Remove rebasing issue
rasmustautsglia Nov 5, 2024
e099dc7
Optimize using of strings for the Entry Widget
AH-MOC Nov 4, 2024
3ef9816
Introduce disabled state for ChatMessageEntry style
igorkravchenko Nov 2, 2024
5388acd
Bump up deployment target from iOS 13 to 14
AH-MOC Nov 6, 2024
b933ab9
Introduce disabled state for file upload list
igorkravchenko Nov 7, 2024
a9cd406
Update dependencies declared in `Podfile` and `Package.swift`
Nov 12, 2024
831fe7c
Disable send message and pick media buttons instead of hiding them
igorkravchenko Nov 11, 2024
f27db89
Chat to Secure Conversation transfer
Nov 8, 2024
7a15db8
Add SC unread message badge on Entry Widget
ykyivskyi-gl Nov 11, 2024
f8f3f4f
Add logs and telemetry for Entry Widget
rasmustautsglia Nov 12, 2024
38f7c82
Update default global colors according to color palette
igorkravchenko Oct 22, 2024
16f846f
Remove deprecated and existing startEngagement methods
ykyivskyi-gl Nov 14, 2024
c8d03cd
Fix remote configuration not being applied to Entry Widget
rasmustautsglia Nov 15, 2024
735e099
Change Chat Button label in EntryWidget
rasmustautsglia Nov 13, 2024
339ed6c
SecureConversation business logic
Nov 18, 2024
9dbb066
Add disabled unified customization for disabled state for chat messag…
AH-MOC Nov 15, 2024
350c00b
Add snapshot tests for bottom banner
igorkravchenko Nov 19, 2024
47505f6
Add entry point for EntryWidget for Secure Conversation
ykyivskyi-gl Nov 20, 2024
eeda083
ViewController refactoring
Nov 20, 2024
1a9d647
Add pending secure messaging logic to EntryWidget
Nov 19, 2024
a4775ce
Apply Unified UI for the SC
AH-MOC Nov 20, 2024
fefe835
Change subheadline color In EntryWidget
rasmustautsglia Nov 20, 2024
7868be7
Extend SCv2 logic with unreadMessageCount
Nov 25, 2024
27a0b67
Add accessibility identifiers to Entry Widget items
AH-MOC Nov 25, 2024
c0c4812
Bump up Core SDK version to 2.0.2 and update SC interface
igorkravchenko Nov 27, 2024
85fca20
Show Entry Widget on SC top banner click
ykyivskyi-gl Nov 26, 2024
6ff94f4
Add Unit and Snapshot tests for top banner on Secure Conversations
ykyivskyi-gl Nov 28, 2024
9893fc4
Fix memory leak in Chat module
Nov 28, 2024
32be88d
Apply unified UI for SC's top banner on ChatView
ykyivskyi-gl Nov 29, 2024
9a08822
Isolate pending interaction logic in separate model
igorkravchenko Nov 29, 2024
058e97e
Fix strict version in Podfile.lock
Dec 6, 2024
4fe0c13
Improve mark as read SC messages
ykyivskyi-gl Dec 5, 2024
b954125
Address unavailability banner showing up for SC flow
igorkravchenko Dec 5, 2024
47d897d
Update SC availability taking into account 'transferring' state
igorkravchenko Dec 5, 2024
7400490
Create PendingInteraction model after configuration
igorkravchenko Dec 11, 2024
258aead
Update dependencies declared in `Podfile` and `Package.swift`
Dec 13, 2024
0b2896c
Handle ongoing engagement in EntryWidget
rasmustautsglia Dec 6, 2024
7a2903c
Create interface for resuming call visualizer
rasmustautsglia Dec 17, 2024
e4554a9
Add a state property to determine resume behavior
rasmustautsglia Dec 19, 2024
e02814a
Fill area under message entry with same bg color as message entry
igorkravchenko Dec 19, 2024
f4bc78c
Handle `follow_up` end reason
Dec 23, 2024
9fc9be8
Fix keeping wrong interactor state after CV engagement
Dec 23, 2024
8cd9091
Fix handling engagement ended flow
Dec 24, 2024
c1d2366
Add tests for Interactor state updates on engagement end
ykyivskyi-gl Dec 30, 2024
b3118ab
Remove bubble related toggles from initial screen in TestingApp
Dec 30, 2024
cb0786b
Update image preview screen logs to align with Android
ykyivskyi-gl Jan 2, 2025
f68c895
Mark deprecated styles as unavailable
Dec 31, 2024
28b2268
Log ongoing engagement event in Entry Widget
rasmustautsglia Dec 31, 2024
aeb13a2
Add snapshot tests for SC's unified UI
ykyivskyi-gl Jan 7, 2025
43e1ccc
Do not cancel enqueuing if new enqueue is the same engagement type
rasmustautsglia Jan 8, 2025
d430249
Remove deprecated methods over a year old
rasmustautsglia Jan 13, 2025
22eee4c
Show ShackBar if there is ongoing Call Visualizer
ykyivskyi-gl Jan 16, 2025
d96c3d0
Fix `skipLiveObservationConfirmations` value after restored engagement
Jan 18, 2025
f2aa05c
Restore bubble when SC Live Upgrade happens
Jan 18, 2025
b7338aa
Fix unexpected capturing in EngagementLauncher
Jan 20, 2025
1fa66b0
Show only one available engagement type in Entry Widget when queueing
rasmustautsglia Jan 17, 2025
80e6f84
Update dependencies declared in `Podfile` and `Package.swift`
Jan 24, 2025
c2cb55a
Erase interactor state on deauthenticate
Jan 24, 2025
32043ae
Take transferred SC into account in `hasPendingInteraction` value
Jan 27, 2025
e76e1f0
Restore Video Call Visualizer on enqueuing if it is running
ykyivskyi-gl Jan 20, 2025
28bcf23
Make interactor as published property
rasmustautsglia Jan 27, 2025
0462436
Use 'Engagement.actionOnEnd' in Widgets for Survey
igorkravchenko Jan 21, 2025
0323794
Switch from Live Chat to SC on ended engagement with '.retain'
igorkravchenko Jan 27, 2025
22b9179
Update dependencies declared in `Podfile` and `Package.swift`
Jan 28, 2025
3640a33
Show snack bar for enqueued engagements
ykyivskyi-gl Jan 27, 2025
5fa3d91
Ignore transferred SC in EntryWidget
Jan 28, 2025
330b5a9
Add test covering migration from Chat to SC
igorkravchenko Jan 28, 2025
e55f0bc
Transferred SC logic
Jan 29, 2025
4d85d01
Rework interactor state
rasmustautsglia Jan 27, 2025
8680815
Fix Chat state during Transferred SC
Jan 29, 2025
a718cac
Replace InteractorProviding with InteractorPublisher
rasmustautsglia Jan 28, 2025
bc70d0c
Implement EngagementLauncher enqueuing logic
ykyivskyi-gl Jan 30, 2025
b89498d
Update dependencies declared in `Podfile` and `Package.swift`
Jan 31, 2025
2846318
Fix restoring engagement when `hasPendingInteraction` is `true`
Jan 30, 2025
bcfb231
Address file upload issue caused by missing socket subscription
igorkravchenko Jan 30, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions GliaWidgets.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Pod::Spec.new do |s|
s.source = { :git => 'https://github.com/salemove/ios-sdk-widgets.git', :tag => s.version.to_s }

s.module_name = 'GliaWidgets'
s.ios.deployment_target = '13.0'
s.ios.deployment_target = '14.0'
s.source_files = 'GliaWidgets/**/*.swift'
s.swift_version = '5.3'

Expand All @@ -19,5 +19,5 @@ Pod::Spec.new do |s|
}
s.exclude_files = ['GliaWidgets/Window/**']

s.dependency 'GliaCoreSDK', '1.5.9'
s.dependency 'GliaCoreSDK', '2.0.7'
end
576 changes: 503 additions & 73 deletions GliaWidgets.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

25 changes: 4 additions & 21 deletions GliaWidgets/Asset.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ private let bundleManaging: BundleManaging = .live
// swiftlint:disable superfluous_disable_command
// swiftlint:disable file_length

@available(*, deprecated, renamed: "ImageAsset")
public typealias AssetType = ImageAsset

public struct ImageAsset {
public fileprivate(set) var name: String
Expand Down Expand Up @@ -65,11 +63,13 @@ public enum Asset {
public static let uploadRemove = ImageAsset(name: "uploadRemove")
public static let chatPickMedia = ImageAsset(name: "chatPickMedia")
public static let chatSend = ImageAsset(name: "chatSend")
public static let sendMessageUnavailableInfo = ImageAsset(name: "send-message-unavailable-info")
public static let unreadMessageIndicator = ImageAsset(name: "unreadMessageIndicator")
public static let back = ImageAsset(name: "back")
public static let close = ImageAsset(name: "close")
public static let browseIcon = ImageAsset(name: "browseIcon")
public static let cameraIcon = ImageAsset(name: "cameraIcon")
public static let chevronDownIcon = ImageAsset(name: "chevronDownIcon")
public static let photoLibraryIcon = ImageAsset(name: "photoLibraryIcon")
public static let gliaLogo = ImageAsset(name: "gliaLogo")
public static let startScreenShare = ImageAsset(name: "startScreenShare")
Expand Down Expand Up @@ -109,11 +109,13 @@ public enum Asset {
uploadRemove,
chatPickMedia,
chatSend,
sendMessageUnavailableInfo,
unreadMessageIndicator,
back,
close,
browseIcon,
cameraIcon,
chevronDownIcon,
photoLibraryIcon,
gliaLogo,
startScreenShare,
Expand All @@ -134,27 +136,9 @@ public enum Asset {
spinner,
]
// swiftlint:enable trailing_comma
@available(*, deprecated, renamed: "allImages")
public static let allValues: [AssetType] = allImages
}
// swiftlint:enable identifier_name line_length nesting type_body_length type_name

public extension Image {
@available(iOS 1.0, tvOS 1.0, watchOS 1.0, *)
@available(OSX, deprecated,
message: "This initializer is unsafe on macOS, please use the ImageAsset.image property")
convenience init!(asset: ImageAsset) {
#if os(iOS) || os(tvOS)
let bundle = bundleManaging.current()
self.init(named: asset.name, in: bundle, compatibleWith: nil)
#elseif os(OSX)
self.init(named: NSImage.Name(asset.name))
#elseif os(watchOS)
self.init(named: asset.name)
#endif
}
}

public extension AssetColorTypeAlias {
@available(iOS 11.0, tvOS 11.0, watchOS 4.0, OSX 10.13, *)
convenience init!(asset: ColorAsset) {
Expand All @@ -168,4 +152,3 @@ public extension AssetColorTypeAlias {
#endif
}
}

10 changes: 5 additions & 5 deletions GliaWidgets/Color.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ import UIKit

enum Color {
static let primary = UIColor(hex: 0x0F6BFF) // blue
static let secondary = UIColor(hex: 0x00B233) // green
static let secondary = UIColor(hex: 0x18901C) // green
static let baseLight = UIColor(hex: 0xFFFFFF) // white
static let systemNegative = UIColor(hex: 0xD11149) // red
static let baseNormal = UIColor(hex: 0x6C7683) // grey
static let baseShade = UIColor(hex: 0x6C7683, alpha: 0.5)
static let systemNegative = UIColor(hex: 0xBC0F42) // red
static let baseNormal = UIColor(hex: 0x616A75) // gray
static let baseShade = UIColor(hex: 0xB6BBC1) // mid-gray
static let baseDark = UIColor(hex: 0x2C0735) // purple
static let baseNeutral = UIColor(hex: 0xF3F3F3) // light gray
static let baseNeutral = UIColor(hex: 0xF7F7F7) // light gray
}
902 changes: 0 additions & 902 deletions GliaWidgets/L10n.swift

This file was deleted.

142 changes: 130 additions & 12 deletions GliaWidgets/Localization.swift
Original file line number Diff line number Diff line change
Expand Up @@ -432,14 +432,106 @@ internal enum Localization {
internal static var message: String { Localization.tr("Localizable", "engagement.queue_wait.message", fallback: "You can continue browsing and we will connect you automatically.") }
}
internal enum SecureMessaging {
/// Messaging
internal static var title: String { Localization.tr("Localizable", "engagement.secure_messaging.title", fallback: "Messaging") }
/// Secure Messaging
internal static var title: String { Localization.tr("Localizable", "engagement.secure_messaging.title", fallback: "Secure Messaging") }
}
internal enum Video {
/// Video
internal static var title: String { Localization.tr("Localizable", "engagement.video.title", fallback: "Video") }
}
}
internal enum EntryWidget {
internal enum Audio {
internal enum Button {
/// Speak through your device
internal static var description: String { Localization.tr("Localizable", "entry_widget.audio.button.description", fallback: "Speak through your device") }
/// Audio
internal static var label: String { Localization.tr("Localizable", "entry_widget.audio.button.label", fallback: "Audio") }
internal enum Accessibility {
/// Starts a call
internal static var hint: String { Localization.tr("Localizable", "entry_widget.audio.button.accessibility.hint", fallback: "Starts a call") }
}
}
}
internal enum CallVisualizer {
/// You are already in contact with the support team
internal static var description: String { Localization.tr("Localizable", "entry_widget.call_visualizer.description", fallback: "You are already in contact with the support team") }
internal enum Button {
/// Call Visualizer
internal static var label: String { Localization.tr("Localizable", "entry_widget.call_visualizer.button.label", fallback: "Call Visualizer") }
}
}
internal enum EmptyState {
/// We are here to assist you during our business hours.
internal static var description: String { Localization.tr("Localizable", "entry_widget.empty_state.description", fallback: "We are here to assist you during our business hours.") }
/// Support team is currently offline
internal static var title: String { Localization.tr("Localizable", "entry_widget.empty_state.title", fallback: "Support team is currently offline") }
}
internal enum ErrorState {
/// We could not load the contacts at this time. This may be due to a temporary syncing issue or network problem.
internal static var description: String { Localization.tr("Localizable", "entry_widget.error_state.description", fallback: "We could not load the contacts at this time. This may be due to a temporary syncing issue or network problem.") }
/// Could not load the contacts
internal static var title: String { Localization.tr("Localizable", "entry_widget.error_state.title", fallback: "Could not load the contacts") }
internal enum TryAgain {
internal enum Button {
/// Try again
internal static var label: String { Localization.tr("Localizable", "entry_widget.error_state.try_again.button.label", fallback: "Try again") }
}
}
}
internal enum LiveChat {
internal enum Button {
/// For the texter in all of us
internal static var description: String { Localization.tr("Localizable", "entry_widget.live_chat.button.description", fallback: "For the texter in all of us") }
/// Chat
internal static var label: String { Localization.tr("Localizable", "entry_widget.live_chat.button.label", fallback: "Chat") }
internal enum Accessibility {
/// Starts a chat
internal static var hint: String { Localization.tr("Localizable", "entry_widget.live_chat.button.accessibility.hint", fallback: "Starts a chat") }
}
}
}
internal enum Loading {
internal enum Accessibility {
/// Loading indicator. Waiting for available options.
internal static var label: String { Localization.tr("Localizable", "entry_widget.loading.accessibility.label", fallback: "Loading indicator. Waiting for available options.") }
}
}
internal enum OngoingEngagement {
/// Ongoing • Tap to return
internal static var description: String { Localization.tr("Localizable", "entry_widget.ongoing_engagement.description", fallback: "Ongoing • Tap to return") }
internal enum Button {
internal enum Accessibility {
/// Returns to ongoing engagement
internal static var hint: String { Localization.tr("Localizable", "entry_widget.ongoing_engagement.button.accessibility.hint", fallback: "Returns to ongoing engagement") }
}
}
}
internal enum SecureMessaging {
internal enum Button {
/// Start a conversation, we’ll get back to you
internal static var description: String { Localization.tr("Localizable", "entry_widget.secure_messaging.button.description", fallback: "Start a conversation, we’ll get back to you") }
/// Secure Messaging
internal static var label: String { Localization.tr("Localizable", "entry_widget.secure_messaging.button.label", fallback: "Secure Messaging") }
internal enum Accessibility {
/// Starts messaging with us
internal static var hint: String { Localization.tr("Localizable", "entry_widget.secure_messaging.button.accessibility.hint", fallback: "Starts messaging with us") }
}
}
}
internal enum Video {
internal enum Button {
/// Face-to-face, just like in person
internal static var description: String { Localization.tr("Localizable", "entry_widget.video.button.description", fallback: "Face-to-face, just like in person") }
/// Video
internal static var label: String { Localization.tr("Localizable", "entry_widget.video.button.label", fallback: "Video") }
internal enum Accessibility {
/// Starts a video call
internal static var hint: String { Localization.tr("Localizable", "entry_widget.video.button.accessibility.hint", fallback: "Starts a video call") }
}
}
}
}
internal enum Error {
/// Something went wrong.
internal static var general: String { Localization.tr("Localizable", "error.general", fallback: "Something went wrong.") }
Expand Down Expand Up @@ -563,11 +655,11 @@ internal enum Localization {
}
}
internal enum MessageCenter {
/// Messaging
internal static var header: String { Localization.tr("Localizable", "message_center.header", fallback: "Messaging") }
/// Secure Messaging
internal static var header: String { Localization.tr("Localizable", "message_center.header", fallback: "Secure Messaging") }
internal enum Confirmation {
/// Your message has been sent. We will get back to you within 48 hours.
internal static var subtitle: String { Localization.tr("Localizable", "message_center.confirmation.subtitle", fallback: "Your message has been sent. We will get back to you within 48 hours.") }
/// Your message has been sent. We will get back to you within 1 business day.
internal static var subtitle: String { Localization.tr("Localizable", "message_center.confirmation.subtitle", fallback: "Your message has been sent. We will get back to you within 1 business day.") }
internal enum CheckMessages {
internal enum Accessibility {
/// Navigates you to the chat transcript.
Expand All @@ -592,10 +684,10 @@ internal enum Localization {
internal static var checkMessages: String { Localization.tr("Localizable", "message_center.welcome.check_messages", fallback: "Check messages") }
/// Your message
internal static var messageTitle: String { Localization.tr("Localizable", "message_center.welcome.message_title", fallback: "Your message") }
/// Send a message and we will get back to you within 48 hours.
internal static var subtitle: String { Localization.tr("Localizable", "message_center.welcome.subtitle", fallback: "Send a message and we will get back to you within 48 hours.") }
/// Welcome to Message Center
internal static var title: String { Localization.tr("Localizable", "message_center.welcome.title", fallback: "Welcome to Message Center") }
/// Send a message and we will get back to you within 1 business day.
internal static var subtitle: String { Localization.tr("Localizable", "message_center.welcome.subtitle", fallback: "Send a message and we will get back to you within 1 business day.") }
/// Welcome to Secure Messaging
internal static var title: String { Localization.tr("Localizable", "message_center.welcome.title", fallback: "Welcome to Secure Messaging") }
internal enum CheckMessages {
internal enum Accessibility {
/// Navigates you to the chat transcript.
Expand All @@ -611,8 +703,8 @@ internal enum Localization {
}
}
internal enum MessageInput {
/// Enter your message
internal static var placeholder: String { Localization.tr("Localizable", "message_center.welcome.message_input.placeholder", fallback: "Enter your message") }
/// Enter message
internal static var placeholder: String { Localization.tr("Localizable", "message_center.welcome.message_input.placeholder", fallback: "Enter message") }
}
internal enum MessageLength {
/// The message cannot exceed 10,000 characters.
Expand Down Expand Up @@ -644,6 +736,32 @@ internal enum Localization {
}
}
}
internal enum SecureMessaging {
internal enum Chat {
internal enum Banner {
/// Secure messaging has an expected response time of 1 business day.
internal static var bottom: String { Localization.tr("Localizable", "secure_messaging.chat.banner.bottom", fallback: "Secure messaging has an expected response time of 1 business day.") }
/// Need live support?
internal static var top: String { Localization.tr("Localizable", "secure_messaging.chat.banner.top", fallback: "Need live support?") }
}
internal enum LeaveCurrentConversation {
/// You have an ongoing conversation. Starting a new conversation before ongoing ones are resolved may lead to our agents overlooking your current query.
internal static var message: String { Localization.tr("Localizable", "secure_messaging.chat.leave_current_conversation.message", fallback: "You have an ongoing conversation. Starting a new conversation before ongoing ones are resolved may lead to our agents overlooking your current query.") }
/// Leave Current Conversation?
internal static var title: String { Localization.tr("Localizable", "secure_messaging.chat.leave_current_conversation.title", fallback: "Leave Current Conversation?") }
internal enum Button {
/// Leave
internal static var negative: String { Localization.tr("Localizable", "secure_messaging.chat.leave_current_conversation.button.negative", fallback: "Leave") }
/// Stay
internal static var positive: String { Localization.tr("Localizable", "secure_messaging.chat.leave_current_conversation.button.positive", fallback: "Stay") }
}
}
internal enum Unavailable {
/// Sending messages is currently not available.
internal static var message: String { Localization.tr("Localizable", "secure_messaging.chat.unavailable.message", fallback: "Sending messages is currently not available.") }
}
}
}
internal enum Survey {
internal enum Action {
/// Please provide an answer.
Expand Down
55 changes: 55 additions & 0 deletions GliaWidgets/Public/Glia/Glia+EngagementLauncher.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
import Foundation

extension Glia {
/// Retrieves an instance of `EngagementLauncher`.
///
/// - Parameters:
/// - queueIds: A list of queue IDs to be used for the engagement launcher. When nil, the default queues will be used.
///
/// - Returns:
/// - `EngagementLauncher` instance.
public func getEngagementLauncher(queueIds: [String]) throws -> EngagementLauncher {
@discardableResult
func getConfiguration() throws -> Configuration {
guard let configuration else {
throw GliaError.sdkIsNotConfigured
}
return configuration
}

@discardableResult
func getInteractor() throws -> Interactor {
guard let interactor else {
loggerPhase.logger.prefixed(Self.self).warning("Interactor is missing")
throw GliaError.sdkIsNotConfigured
}
return interactor
}

// In order to align behaviour between platforms,
// `GliaError.engagementExists` is no longer thrown,
// instead engagement is getting restored.
try getConfiguration()
try getInteractor()

loggerPhase.logger.info("Returning an Engagement Launcher")

return EngagementLauncher { [weak self] engagementKind, sceneProvider in
guard let self else { return }
let parameters = try getEngagementParameters(
configuration: getConfiguration(),
interactor: getInteractor(),
queueIds: queueIds
)
self.resolveEngagementState(
engagementKind: engagementKind,
sceneProvider: sceneProvider,
configuration: parameters.configuration,
interactor: parameters.interactor,
features: parameters.features,
viewFactory: parameters.viewFactory,
ongoingEngagementMediaStreams: parameters.ongoingEngagementMediaStreams
)
}
}
}
Loading
Loading