Skip to content

dialpad/dx-ios-clients

Repository files navigation

Getting Started with Ai Chatbot

Chatbot support for native iOS apps

Dialpad's Ai Chatbot is supported in the native iOS apps via WKWebView. This repo comes with a simple Swift package that can be embedded directly in the native iOS app.

Key Features

  • Bi-directional Communication:

    • Your iOS app can send commands to the chatbot using NotificationCenter.
    • The chatbot can send events to your iOS app using NotificationCenter.
  • WKWebView-based Implementation: Leverages WKWebView for rendering the chatbot interface.

  • Compose Support: The Package includes a DialpadChatbotView View for easy integration with your SwiftUI.

Supported NotificationCenter Events

  • Chatbot session started
NotificationCenter.default.publisher(for: NSNotification.Name.chatbotSessionStarted)
  • Chatbot session ended
NotificationCenter.default.publisher(for: NSNotification.Name.chatbotSessionEnded)
  • End chatbot session
NotificationCenter.default.post(
    name: Notification.Name.endChatbotSession,
    object: nil
)

Usage

Installation guide

Visit the official Xcode doc in this page for more information. Use the GitHub repo for dx-ios-clients to add it as a dependency to your project.

Integrating the DialpadChatbotView

Use the DialpadChatbotView View to display the chatbot within your app.

import DialpadChatbot

struct ContentView: View {
    let url: String
    var body: some View {
        VStack(
            alignment: .trailing, 
            spacing: 0,
            content: {
                DialpadChatbotView(url: url)
            })
    }
}

Parameters:

  • url: The URL of the Chatbot to be loaded in the WebView.

Known Issues and Unsupported features

☐ Chatbot experience in landscope mode.
☐ Network interruptions.
☐ Handling app sent to background.
☐ Handling app brought from the background.

About

📱 Ai Chatbot for iOS, for integrating Dialpad Ai Chatbot into your iOS application.

Resources

License

Stars

Watchers

Forks

Contributors 2

  •  
  •  

Languages