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.
-
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.
- Your iOS app can send commands to the chatbot using
-
WKWebView-based Implementation: Leverages
WKWebViewfor rendering the chatbot interface. -
Compose Support: The Package includes a
DialpadChatbotViewView for easy integration with your SwiftUI.
- 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
)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.
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)
})
}
}url: The URL of the Chatbot to be loaded in the WebView.
☐ Chatbot experience in landscope mode.
☐ Network interruptions.
☐ Handling app sent to background.
☐ Handling app brought from the background.