Setup

Nabla iOS Messaging module set up

📘

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

The messaging module makes it easy to build a modern messaging experience and to allow to interact with your care team via text, image, video, document and audio messages.

For a quick try-out of the Messaging module, you can check out our Messaging sample app.

Adding the dependency

Swift Package Manager

The NablaMessagingUI and NablaMessagingCore modules come 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 desired 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 NablaMessagingUI (or NablaMessagingCore if you just need the core APIs)

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

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

Or, if you just need the core APIs:

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

Cocoapods

Add the following dependency in your Podfile

pod 'NablaMessagingUI'

Or, if you just need the core APIs:

pod 'NablaMessagingCore'

And then run pod install to update your project.

Setup Messaging module

Then, you need to initialize the NablaMessagingModule when calling NablaClient.initialize:

import NablaCore
import NablaMessagingCore

class AppDelegate: UIResponder, UIApplicationDelegate {

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

      // ...

      return true
    }
}