Skip to main content

Installation

Description

In this section, you can find all the information related to the integration of:

Professional ListChatMy HealthVideocall

Requirements

Please make sure you are using the last Xcode compatible with our SDK

SwiftXcodeMeetingDoctorsiOSStatus
5.715.36.2.x+13.0+Supported
5.715.37.1.x+13.0+Supported

In order to check the last updates please check our Release Notes.

Swift Package Manager

To install the MeetingDoctors library you must first include MeetingDoctors package.

Steps:

  • Open Xcode then select Project > Package Dependencies > "+"
  • Add repo url: https://github.com/Meeting-Doctors/meetingdoctors-sdk-spm

Access permissions

info

Access to camera or photo gallery always requires explicit permission from the user. See Apple Documentation

Your app must provide an explanation for its use of capture devices using the NSCameraUsageDescription and NSPhotoLibraryUsageDescription Info.plist key. iOS displays this explanation when initially asking the user for permission to attach an element in the current conversation.

caution

Attempting to attach a gallery photo or start a camera session without an usage description will raise an exception.

Integration

To use the library is necessary to import it in our AppDelegate:

import MeetingDoctorsSDK

Next, as soon as we receive a notification from the system telling that our application is already active, we must configure the framework by providing the client's API key configuration:

class func initialize(_ application: UIApplication = UIApplication.shared, with configuration: MeetingDoctorsSDK.MeetingDoctors.Configuration, options _: [UIApplication.LaunchOptionsKey : Any]?, completion: ((MeetingDoctorsSDK.MeetingDoctorsResult<MeetingDoctorsSDK.MeetingDoctorsInstallationType>) -> Void)? = nil) -> UUID?

Last method parameter defines asynchronous initialization result of type MeetingDoctorsInstallationType. It does return framework and installation information responding to the protocol:

public protocol MeetingDoctorsInstallationType {
/// Unique intallation identifier for this device
var installationId: UUID { get }
/// UIDevice.current.systemVersion
var systemVersion: String { get }
/// MeetingDoctors Framework build version number
var frameworkVersion: String { get }
/// Device manufacturer name (i.e. x86_64, iPhone8,2, etc.)
var deviceModel: String { get }
}

To initialize MeetingDoctorsSDK, you need to create a configuration object:

public struct Configuration {
// Chat Api key
public let secret: String
// If is `.development`, SDK will be comunicate with sandbox environment. if is `.production` interact with Production environment. Finally if value is `.staging` SDK wil be comunicate with staging environment. By default is `.production`
public let environment: EnvironmentType
// call sound for videocall screen when professional is calling (Background). File name must be the same for call notification.
public let videocallLongSoundFileName: String?
// call sound for videocall screen when professional is calling (Foreground). File name must be the same for call notification.
public let videocallShortSoundFileName: String?
}

Initialization returns an optional (@discardableResult) synchronous installation identifier that will only be valid after initialize call has succeeded once:

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
[...]
if let clientSecret: String = “api_key” {
let configuration = MeetingDoctors.Configuration(secret: clientSecret)
if let uuid: UUID = MeetingDoctors.initialize(with: configuration, options: launchOptions) {
NSLog("[MeetingDoctorsApplicationPlugin] Synchronous installation identifier: '\(uuid.uuidString)'")
}
}
[...]
}

Without the initialization process, subsequent calls to the library will trigger error results.