Setup

Nabla iOS Scheduling module set up

📘

Before integrating the Scheduling module, make sure you followed the SDK installation guide.

Scheduling is dependent on the Video calls module, so that patients and providers can video call on appointments, which is why we'll also be adding this module in the steps below.

The scheduling module allows your Patients to see and manage their appointments with Providers.

Adding the dependencies

Swift Package Manager

The NablaScheduling and NablaVideoCall modules comes as a part of Nabla SPM package. Since you should have added our repository as a dependency to your app already, you only need to link the NablaScheduling and NablaVideoCall library to your target. There are two ways to do it, depending on how you are using SPM.

If you've added Nabla package from Xcode, simply add the library to your target:

  • Select your project in Xcode
  • Go tot the General tab
  • In the Frameworks, Libraries and Embedded Content section
  • Click the + button
  • Add NablaScheduling and NablaVideoCall

If you are using a Package.swift file, add those lines to your target.dependencies array:

.product(name: "NablaScheduling", package: "nabla-ios"),
.product(name: "NablaVideoCall", package: "nabla-ios"),

Cocoapods

Add the following dependencies in your Podfile

pod 'NablaScheduling'
pod 'NablaVideoCall'

And then run pod install to update your project.

Project settings

Few project settings are required before being able to use NablaVideoCall.

Set up camera and microphone usage descriptions

It is mandatory to define some NSMicrophoneUsageDescription and NSCameraUsageDescription before requesting the camera & microphone permissions. Otherwise, your app will crash.

You can define those in your Info.plist file. More info here and there.

Register your app for VOIP background execution

By default, iOS apps are inactive when sent to background. This means that your patients won't be able to hear or speak if they switch to another app while inside a video call.

To prevent this, you must add the UIBackgroundModes key to your Info.plist file, then add a voip item. If done correctly, Xcode should recognize those keys and replace them with human-readable descriptions:

Link to the documentation.

Disable BITCODE for debug builds

We are using the WebRTC library to implement NablaVideoCall. This library does not support BITCODE for debug builds. You must disable it in your Build Settings. Find the Enable Bitcode key, expand it, and set it to no for debug builds.

Setup Scheduling module

Then, you need to initialize the NablaSchedulingModule and NablaVideoCallModule when calling NablaClient.initialize:

import NablaCore

class AppDelegate: UIResponder, UIApplicationDelegate {

    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
      NablaClient.initialize(
        modules: [
          NablaSchedulingModule(),
          NablaVideoCallModule()
        ],
        ...
      )

      // ...

      return true
    }
}

Make your organization ready

Before using the SDK to schedule appointments, make sure:

  • You specify consultation categories in your organization settings. Each category has a name, duration and associated providers.
  • At least one of the specified providers has availability. Each provider can specify their —single or recurrent— availabilities on the calendar tab.