Concierge iOS SDK
Version: 1.1.3
Minimum supported iOS version: 15 (this is what we test)
Minimum compiling iOS version: 14 (this is where it compiles but not actually working and we block it by warning message on SDK initial screen)
UI framework: SwiftUI
Appearance: Light/Dark
Supported orientations: Portrait
Supported languages: English/Ukrainian/Russian/Kazakh

How to setup the SDK
To get the dependency, you first need to configure access to our repository.
Install AWS CLI using this guide.
Configure AWS CLI using the credentials provided by us. To do this, run the following command in your terminal.
> aws configure
# After executing the command, you will be prompted to enter the following information
AWS Access Key ID [None]: <YOUR_ACCESS_KEY>
AWS Secret Access Key [None]: <YOUR_SECRET_KEY>
Default region name [None]: eu-central-1
Default output format [None]: jsonConfigure your swift client using this AWS CLI CodeArtifact command
aws codeartifact login --tool swift --repository concierge-sdk --domain infocus --domain-owner 346627266603 --region eu-central-1Modify the Package.swift file within your application project directory to adjust the package dependencies utilized by your project. If the Package.swift file does not have a dependencies section, include one. Within the targets section, add the targets requiring the dependency.
...
],
dependencies: [
.package(id: "ios.concierge-ios-sdk", from: "1.1.3")
],
targets: [
.target(
name: "MyApp",
dependencies: ["concierge_sdk"]
),...
],
...Use the resolve command to download the package dependencies from CodeArtifact.
swift package resolveAlternatively, you can add packages by navigating to App > package dependencies on Xcode. “Click” on the + icon, Enter ios.concierge-ios-sdk. Once the package is found, choose the package and “Click” on Add Package. After a second or two, the package name appears on the list. On the top right side, you can verify the source repository (next to the Registry label).

Import the framework
import concierge_sdkAdd strings to Info.plist to avoid crashes

To init the SDK you will need to set a client token and in which way the token was retrieved (by list of phone hashes or by customer id). To obtain this token, your backend must have the appropriate API. You need to implement the logic for retrieving this token from your backend and passing it to the SDK. Init ConciergeSDK with your client token
let conciergeSDK = ConciergeSDK(
clientToken: "<<YOUR CLIENT TOKEN>>",
authType: .byPhoneHash /// or .byCustomerId
)[Optionally] Set language:
conciergeSDK.setLanguage(.en)
// You will need to execute conciergeSDK.createMainView() again
// to change texts in some system controls[Optionally] Set colors:
conciergeSDK.setColors(
ConciergeColors(
mainColor: Color(hex: "#C28BFC"),
mainColorTinted: Color(hex: "#E3DEFC"),
defaultShadowColor: Color.dynamicColor(
light: Color(red: 0.525, green: 0.442, blue: 0.613, opacity: 0.13),
dark: Color(red: 0.035, green: 0.031, blue: 0.157, opacity: 0.5)
),
mainBlack: Color.dynamicColor(
light: Color(hex: "#090828"),
dark: Color(hex: "#E3DEFC")
),
mainGray: Color.gray,
mainWhite: Color(hex: "#FFFFFF"),
background: Color.dynamicColor(
light: Color(hex: "#F6F6FA"),
dark: Color(hex: "#090828")
),
intermediateBackgroundColor: Color.dynamicColor(
light: Color(hex: "#FFFFFF"),
dark: Color(hex: "#1E1240")
),
searchIconColor: Color.gray,
searchPlaceholderColor: Color.gray
)
)[Optionally] Set images:
conciergeSDK.setImages(
ConciergeImages(
conciergeAvatarImage: Image(systemName: "person"),
infoLogoImage: Image(systemName: "apple.logo")
)
)[Optionally] Set fonts:
conciergeSDK.setFonts(
ConciergeFonts(customFontName: "Rubik-Medium")
)[Optionally] Set custom texts if needed:
conciergeSDK.setTexts(
ConciergeTexts(
chatInfoAdditionalText: "For questions about Premium cards and transactions, please contact the XXXX toll-free line."
)
)[Optionally] Set other UI settings if needed:
conciergeSDK.setUISettings(
ConciergeUISettings(
chatStyle: .messenger,
chatFilePickerEnabled: true,
shouldShowVisaLogoInInfo: false
)
)Set delegate and implement delegate methods
conciergeSDK.setDelegate(self)Call start() function
conciergeSDK.start()Instantiate SwiftUI view:
conciergeSDK.createMainView() Due to the tab bar and navigation bars, It should be presented as a full screen cover or as separate window Full example:
import SwiftUI
import concierge_sdk
class ContentViewModel: ObservableObject, ConciergeSDK.Delegate {
enum State: Hashable {
case loading
case error(String)
case regular
}
@Published var state: State = .loading
let conciergeSDK: ConciergeSDK
init() {
let conciergeSDK = ConciergeSDK(
clientToken: "<<YOUR CLIENT TOKEN>>",
authType: .byPhoneHash /// or .byCustomerId
)
conciergeSDK.setLanguage(.kz)
conciergeSDK.setColors(ConciergeColors(mainColor: .indigo))
conciergeSDK.setImages(ConciergeImages(conciergeAvatarImage: Image(systemName: "person")))
conciergeSDK.setFonts(ConciergeFonts(customFontName: "Rubik-Medium"))
conciergeSDK.setTexts(ConciergeTexts(chatInfoAdditionalText: "<<Your additional text on chat info screen>>"))
self.conciergeSDK = conciergeSDK
conciergeSDK.setDelegate(self)
conciergeSDK.start()
}
// MARK: ConciergeSDK.Delegate conformance
func conciergeSDKDidStartSuccessfully(isSubscribed: Bool) {
state = .regular
}
func conciergeSDKDidSubscribe() {
// Update the SwiftUI view after subscription
state = .regular
}
func conciergeSDKDidStartWithError(_ error: any Error) {
state = .error(error.localizedDescription)
}
func conciergeSDKCantAuthorize() {
conciergeSDK.setClientToken("<<NEW CLIENT TOKEN>>")
conciergeSDK.start()
}
}
struct ContentView: View {
@ObservedObject var viewModel = ContentViewModel()
var body: some View {
switch viewModel.state {
case .regular:
viewModel.conciergeSDK.createMainView()
case .loading:
ProgressView()
case .error(let string):
VStack {
Text(string)
}
}
}
}Last updated