Live Chat SDK Swift

Configuration

To use this SDK connector, you must meet the following requirements:

  • XCode 10.0+ (recommended to use XCode 12.1+)

  • Swift 4.0, 4.1, 4.2, 5.0

Installation

Recommended to use framework from .xcframework.

Steps to install using this framework:

  1. Obtain file imi_dolphin_livechat_ios_xcframework

  2. Open your Xcode project and navigate to Project Settings > General

  3. Under Framework, Libraries, and Embedded Content, click button '+' and select Add Other... > Add Files..

  4. Locate and add imi_dolphin_livechat_ios_xcframework to your project

  5. Ensure that Embed & Sign is selected to properly bundle the framework with your app

  6. Repeat the same steps to add any dependencies like StompClientLib dan CryptoSwift.xcframework if needed

Import Library

Add the following import statement at the top of your Swift file:

Initialize User Profile

Create a user profile using the classDolphinProfile :

Component Explanation:

Name
Description

DolphinProfile

Represents the identify of the user initiating the chat

name

Represents the name of the user

email

Represents the user's email

phoneNumber

Represents the user's phone number

uid

Used to determine whether this user session will create a new ticket or not

Initialize Connection Variables

Define the required notification listeners and connection variables:

Setup Connection in viewDidLoad

Implement Notification Handlers

Sending Messages

Send Text Message

Send Image

Ensure image file meets these conditions:

  • Image size must be under 2MB

  • Using format PNG or JPEG

Send Video

Ensure video file meets these conditions:

  • Video size must be under 2MB

  • Using format MP4

Send File (Document and Audio as File)

Ensure documents file meets these conditions:

  • Document/Audio size must be under 2MB

  • Memiliki format PDF

Last updated

Was this helpful?