Gyant iOS SDK binaries
GYANT combines messaging, AI, and medical experts to radically improve the diagnosis and treatment of non-urgent conditions. GYANT makes treatment faster, more effective & more delightful. Our purpose is to transform healthcare from the outside in — to create a new care standard for everyone.
Add Gyant repo:
pod repo add gyant-podspecs git@github.com:GYANTINC/gyant-podspecs.git
Add Gyant Specs source to your Podfile in the following order:
source 'git@github.com:GYANTINC/gyant-podspecs.git'
source 'https://github.com/CocoaPods/Specs.git'
Make sure gyant-podspecs source is the first one
Add GyantChatSDK pod to your app target.
pod 'GyantChatSDK', '~> 1.1.1'
Install the pod.
pod install
GyantChatSDK does not offer bitcode compatibility for now.
Make sure to disable bitcode in your build settings:
Adding the NSLocationWhenInUseUsageDescription key in Info.plist is required to enable the app to access the user location. The user location is required in some user flows like Find a Clinic, etc.
Import the GyantChatSDK framework in the application delegate.
import GyantChatSDK
Start the SDK by adding the following code snippet in the application
application delegate method.
GyantChat.start(withClientID: "<YOUR-CLIENT-ID>",
patientData: nil,
theme: nil,
isDev: true)
To change the chat view appearance:
let botPalette = ["primaryColor1":"ff0000"]
let providerPalette = ["primaryColor1":"00ff00"]
let theme = ["bot": botPalette, "provider": providerPalette]
GyantChat.start(withClientID: "<YOUR-CLIENT-ID>",
patientData: nil,
theme: theme,
isDev: true)
For more details about theme configuration read here.
To provide additional patient information:
```swift
let patientData = GyantChatPatientData()
patientData.patientId = "<YOUR-PATIENT-ID>"
patientData.gender = "male" // male or female
patientData.visitReason = "fever"
patientData.dateOfBirth = "2001-03-26T20:28:32.383+0000"
GyantChat.start(withClientID: "<YOUR-CLIENT-ID>",
patientData: patientData,
theme: nil,
isDev: true)
```
**Note**: The __isDev__ parameter must be changed to false before submitting the app to production.
Present the chat view by adding the following code snipped in any view controller.
let chatVC = GyantChat.createChatViewController()!
self.present(chatVC, animated: true, completion: nil)
[Optional] GyantChatDelegate
Set the delegate.
GyantChat.setDelegate(self)
Implement push notifications registration method. This method is called when during the flow the bot asks the user to enable push notifications. Depending on the existing app requirements this can just retrieve the already registered token or trigger the complete iOS registration process.
func gyantRegister(forNotifications completion: @escaping TokenCompletionHandler) {
completion("<DEVICE-TOKEN>")
}
This method is called for every message received from the server. The message parameter could be empty for special messages like carousels, images, etc.
func gyantDidReceiveMessage(_ message: String) {
// Your code here
}
This method is called for every new diagnosis from the server. The diagnosis parameter will contain the diagnosis information.
func gyantDidReceiveDiagnosis(_ diagnosis: [AnyHashable : Any]) {
// Your code here
}
(Optional) Change the patient data after initializing the SDK.
GyantChat.changePatientData(...)
All the fields available in GyantChatPatientData are optional.
Field | Description |
---|---|
patientId | Patient ID on the client’s side and can be any string/format. Max. lenght is 4096 |
name | Patient full name |
firstName | Patient first name |
lastName | Patient last name |
gender | Patient gender, e.g: male or female. |
phone | Patient phone number |
dateOfBirth | Patient date of birth. Can use UTC, e.g. 2019-03-26T20:28:32.383+0000 |
visitReason | Patient visit reason if known |
The samples included with the SDK for iOS are standalone projects that are already set up for you. You can also integrate the SDK for iOS with your own existing project.
To allow a more seamless integration into existing apps, the SDK supports color customization. Currently, two different palletes are available: bot and provider. The bot palette is used during chat bot conversations while the provider will be loaded when the user is talking to a human (doctor, nurse, etc).
For each palette the following RGB colors could be customized:
Name | Description | bot | provider |
---|---|---|---|
primaryColor1 |
| ff4cb9f7 | ff1f5075 |
primaryColor2 | Clinic and Provider cards text color | ff3ea9f5 | ff3ea9f5 |
primaryColor3 | n/a | ||
primaryColor4 |
| ff79c7ff | ff296a9c |
secondaryColor1 |
| ffffffff | ffffffff |
secondaryColor2 | Success notification background color | ff4cd964 | ff4cd964 |
secondaryColor3 | Error notification background color | fff55040 | fff55040 |
secondaryColor4 | Provider bubble background color | ff62849e | ff62849e |
extraColor1 |
| ff13324a | ff0f77c6 |
extraColor2 | Card subtitle text color | ff767676 | ff767676 |
extraColor3 | Send button disabled icon color | ffaaaaaa | ffaaaaaa |
extraColor4 | Provider avatar placeholder background color. | ||
extraColor5 |
| ff13324a | ff13324a |
Copyright © 2019 GYANT.com, Inc. All rights reserved.