MluviiChatLibrary
is a feature-rich SDK for iOS that provides an interface for managing and displaying web-based chat functionality. Utilizing WebKit, it enables seamless interaction between your iOS application and web content, allowing you to integrate chat sessions effortlessly.
- Web-based Chat Interface: Leverage WKWebView to display chat or A/V within your app.
- Customizable Chat Sessions: Configure company GUID, tenant ID, language, preset name, and scope.
- Event Handling: Receive callbacks for chat events, status updates, and termination.
- Responsive Design: Automatically respond to orientation changes.
- Add Custom Data: Inject custom data into your chat sessions.
- iOS 11.0 or later
- Xcode 10.0 or later
If you want the application to function correctly (such as sending files, accessing the camera, and microphone), you need to add explanations in the info.plist file specifying why your application requires access to these permissions. Specifically, the required items are:
- Privacy - Camera Usage Description: Explains the reason for needing access to the camera.
- Privacy - Microphone Usage Description: Explains the reason for needing access to the microphone.
- Privacy - Media Library Usage Description: Explains the reason for needing access to the media library.
For more information, visit the Apple Developer's Guide to Media Capture on iOS.
Please note, in iOS 10 or higher, if you do not define the required permissions in the info.plist file, and the application tries to use them, the entire application will crash. Make sure to add the necessary permissions to avoid application crashes.
In your info.plist file, add the following:
<key>NSCameraUsageDescription</key>
<string>Reason for camera usage</string>
<key>NSMicrophoneUsageDescription</key>
<string>Reason for microphone usage</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>Reason for media library usage</string>
- Clone or download the
MluviiChatLibrary
repository. - Drag and drop the
MluviiChatLibrary.swift
file into your project. - Ensure that
WebKit.framework
is added to your project.
swiftCopy code
import MluviiChat
let chatLibrary = MluviiChatLibrary()
swiftCopy code
let webView = chatLibrary.createWebView(
url: "your-url",
companyGuid: "guid",
tenantId: "tenant-id",
presetName: "preset-name",
language: "en",
scope: "scope"
)
swiftCopy code
chatLibrary.setChatEnded {
print("Chat ended")
}
chatLibrary.setStatusUpdater { status in
print("Status update: \(status)")
}
chatLibrary.setMluviiEventCallbackFunc { event, sessionId in
print("Event: \(event), Session ID: \(sessionId ?? 0)")
}
swiftCopy code
chatLibrary.openChat()
chatLibrary.resetUrl()
chatLibrary.addCustomData(name: "name", value: "value")
chatLibrary.openVideo()
For support, please contact Mluvii Support.
To contribute, please fork the repository and submit a pull request.
MluviiChatLibrary
is available under the MIT license. See the LICENSE file for more details.