Why Your Mobile App Needs a Native Chatbot SDK (Not a WebView)
There are two ways to put a chatbot inside a mobile app. The quick way loads your web chat widget in a WebView, an embedded browser. The better way uses a native SDK that draws the chat with the platform's own UI components. A WebView can work for a chat used now and then, but it brings browser overhead, weaker integration with push notifications and app navigation, and a look that rarely matches the rest of the app.
Native SDK vs WebView
| Factor | WebView wrapper | Native SDK |
|---|---|---|
| Rendering | A web page inside the app | Native views (Compose, SwiftUI, Flutter widgets, React Native components) |
| Offline behaviour | Needs a connection to load | Messages queued and sent when the connection returns |
| Push notifications | Extra work to wire up | FCM (Android) and APNs (iOS) support built in |
| Look and feel | Looks like a website | Follows your app's theme, including dark mode |
| Device features | Limited by web permissions | Native file and image pickers |
| Memory and battery | Runs a browser engine | Only the views you show |
Conferbot has native SDKs for Android (Kotlin, with XML Views and Jetpack Compose), iOS (Swift, with UIKit and SwiftUI), Flutter (Dart) and React Native (TypeScript). The source is public on GitHub: conferbot-android, conferbot-ios, conferbot-flutter and conferbot-react-native.
What the SDKs Include
- Real-time messaging over Socket.IO
- Offline support: messages queue while offline and send when the connection returns
- Live agent handover: the conversation moves from bot to a person in the same chat, with typing indicators
- File uploads: images and documents
- Push notifications: FCM on Android, APNs on iOS
- Theming: colours, fonts and dark mode
- Drop-in or custom UI: use the ready-made chat screen or build your own on the SDK's state
The bot itself is built once in the Conferbot builder, with an AI agent that can answer from your knowledge base, and runs the same in your app, on your website and in messaging apps.
Android SDK: Add a Chatbot to Your Android App
Requirements
- Android 5.0+ (minSdk 21)
- Kotlin
- Your Conferbot API key and bot ID
Step 1: Add the SDK
Add the SDK to your project following the installation section of the conferbot-android README, which lists the repository and dependency coordinates for the current release, then sync Gradle.
Step 2: Initialise in Your Application Class
import android.app.Application
import com.conferbot.sdk.core.Conferbot
import com.conferbot.sdk.models.ConferBotConfig
class MyApplication : Application() {
override fun onCreate() {
super.onCreate()
Conferbot.initialize(
context = this,
apiKey = "YOUR_API_KEY",
botId = "YOUR_BOT_ID",
config = ConferBotConfig(
enableNotifications = true,
enableOfflineMode = true
)
)
}
}Step 3: Show the Chat
Option A, full-screen chat Activity:
Conferbot.openChat(context)Option B, Jetpack Compose:
@Composable
fun HomeScreen() {
var showChat by remember { mutableStateOf(false) }
Button(onClick = { showChat = true }) { Text("Support Chat") }
if (showChat) {
ConferBotChatScreen(onDismiss = { showChat = false })
}
}Option C, headless: collect the SDK's state flows (messages, connection status, current agent) and draw your own UI.
The Android SDK uses Retrofit for REST calls, Socket.IO for real-time messages, and Material Design 3 components with automatic dark theme.
iOS SDK: Add a Chatbot to Your iOS App
Requirements
- iOS 14+
- Swift, with UIKit or SwiftUI
- Your Conferbot API key and bot ID
Step 1: Add the Package
In Xcode, choose File > Add Packages and enter the repository URL https://github.com/conferbot/conferbot-ios. CocoaPods instructions are in the conferbot-ios README.
Step 2: Initialise
import SwiftUI
import Conferbot
@main
struct YourApp: App {
init() {
Conferbot.shared.initialize(
apiKey: "YOUR_API_KEY",
botId: "YOUR_BOT_ID"
)
}
var body: some Scene {
WindowGroup { ContentView() }
}
}Step 3: Show the Chat
SwiftUI:
struct ContentView: View {
@State private var showChat = false
var body: some View {
Button("Support Chat") { showChat = true }
.sheet(isPresented: $showChat) { ChatView() }
}
}UIKit:
Conferbot.shared.present(from: self)The iOS SDK supports UIKit and SwiftUI, APNs push notifications for agent replies, and automatic light and dark mode.
Flutter SDK: Add a Chatbot to Your Flutter App
Requirements
- Flutter 3.10+ and Dart 3
- Your Conferbot API key and bot ID
Step 1: Add the Package
Add conferbot_flutter to your project as described in the conferbot-flutter README, then run flutter pub get.
Step 2: Wrap Your App With the Provider
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:conferbot_flutter/conferbot_flutter.dart';
void main() {
runApp(
ChangeNotifierProvider(
create: (_) => ConferBotProvider(
apiKey: 'YOUR_API_KEY',
botId: 'YOUR_BOT_ID',
config: ConferBotConfig(
enableNotifications: true,
enableOfflineMode: true,
),
),
child: MyApp(),
),
);
}Step 3: Show the Chat Widget
ChatWidget(
title: 'Support Chat',
showTimestamps: true,
)Push it as a route or embed it in a screen. For a custom design, read the provider's state and build your own widgets.
Cross-Platform Advantage
With the Flutter SDK, one codebase ships the chat to iOS and Android, with consistent behaviour on both.
React Native SDK: Add a Chatbot to Your React Native App
Requirements
- React 17+ and React Native 0.70+
- TypeScript recommended
- Your Conferbot API key and bot ID
Step 1: Add the Package
Install @conferbot/react-native following the conferbot-react-native README, which covers peer dependencies and native setup.
Step 2: Wrap Your App With the Provider
import { ConferBotProvider } from '@conferbot/react-native';
export default function App() {
return (
<ConferBotProvider
apiKey="YOUR_API_KEY"
botId="YOUR_BOT_ID"
config={{ enableNotifications: true, enableOfflineMode: true }}
>
{/* your app */}
</ConferBotProvider>
);
}Step 3: Open the Chat From Any Screen
import { Button } from 'react-native';
import { useConferBot } from '@conferbot/react-native';
export default function HomeScreen() {
const { openChat } = useConferBot();
return <Button title="Open Support Chat" onPress={() => openChat()} />;
}The SDK is written in TypeScript with type definitions, uses native React Native components (no WebView), and includes event tracking. You can use the drop-in widget, build a fully custom UI on the hook, or mix the two.
Which SDK Should You Use? Decision Guide
| Your Situation | Recommended SDK | Why |
|---|---|---|
| Building a new Android app | Android SDK | XML Views or Jetpack Compose, Material Design 3 |
| Building a new iOS app | iOS SDK | SwiftUI + UIKit support, Apple design guidelines |
| Building for both iOS + Android | Flutter SDK | Single codebase, consistent UX, great performance |
| Existing React Native app | React Native SDK | Drop-in provider, TypeScript, hooks-based API |
| Web app (React, Next.js, etc.) | Web widget | One script snippet; see the React install guide |
| Don't want to build an app | WhatsApp/Messenger | No app needed, reach users on existing platforms |
All SDKs Share the Same Backend
Regardless of which SDK you choose, you get the same bot logic, same knowledge base, same analytics, and same live agent handover. Build your bot once in the Conferbot builder, and it works identically across all platforms.
Integration Patterns
The SDKs support three integration patterns (exact names differ per platform; see each README):
- Drop-in screen: open the ready-made chat screen from a button. Handles UI, state, networking and offline queuing. Best for getting started fast.
- Embedded: place the chat view inside one of your own screens or sheets.
- Headless: use the SDK's state and functions with your own UI, for apps with strict design systems.
How to Benchmark a Chat SDK: Native vs WebView
The difference between a native SDK and a WebView shows up in load time, memory, battery and smoothness, and the size of the gap depends on your app and devices. Rather than rely on any vendor's published numbers, including ours, measure it in your own app.
What to Measure
| Test | What to measure | Tool |
|---|---|---|
| Time to chat | From tapping the chat button to the first message visible | Screen recording, or Android Studio and Xcode profilers |
| Memory | Memory added after opening chat and exchanging 100 messages with images | Android Studio Memory Profiler, Xcode Instruments (Allocations) |
| Battery | Energy use with chat open and idle, and in the background with push on | Android Studio Energy Profiler, Xcode Energy Log |
| Smoothness | Dropped frames while scrolling a long conversation | Android GPU rendering profile, Xcode Instruments (Animation Hitches) |
| Offline recovery | Send messages in airplane mode, reconnect, check delivery and order | Manual test |
| App size | Download and install size added by the SDK | Play Console and App Store Connect size reports |
Test on Realistic Devices
Test on at least three devices: a recent flagship, a mid-range phone and an older low-end phone. Low-end devices are where differences show most and where many users are. Run the same scenarios for each SDK or WebView you are comparing, inside your real app rather than a blank demo, because your app's own work (maps, video, images) competes for the same resources.
Network Efficiency
A WebView chat loads the web widget's code and assets when it opens; a native SDK sends only message data over its real-time connection. Check data usage per conversation with the network profiler, which matters for users on metered connections.
Build It Into CI
Once you have a baseline, add the key measurements to your release testing so a later SDK or app update cannot quietly slow the chat down. For a wider comparison of platforms, including AI and channel coverage, see our no-code chatbot builder comparison, and if you are deciding whether to build your own chat at all, read how to build a chatbot without coding.
Security and Data Privacy in Mobile Chat SDKs
Mobile chatbots handle sensitive data - customer names, email addresses, payment details, health information, and conversation history. Security and privacy are not optional features; they are foundational requirements that affect your compliance posture, App Store approval, and user trust.
Data Encryption Standards
A production-grade mobile chat integration should cover encryption at every layer:
| Layer | Standard | What It Protects |
|---|---|---|
| In-transit encryption | TLS 1.3 | All data moving between the app and server |
| At-rest encryption (device) | AES-256 | Chat history, cached messages, user tokens stored locally |
| At-rest encryption (server) | AES-256 | Conversation logs, user profiles, knowledge base data |
| Key management | Hardware-backed keystore | Encryption keys stored in Android Keystore or iOS Secure Enclave |
| WebSocket connections | WSS (TLS-encrypted) | Real-time messaging channel |
Ask any SDK vendor, including us, how each layer is handled, and check the SDK source, which for Conferbot is public on GitHub.
Local Data Storage and Retention
Chat SDKs store data locally for offline support and conversation persistence. Ensure your SDK handles local storage responsibly:
- Encrypted database: Chat history should be stored in an encrypted local database (SQLCipher for Android Room, encrypted Core Data for iOS). Plain-text SQLite databases are a vulnerability.
- Retention limits: decide how long chat history stays on the device and on the server, and purge older data automatically. This limits exposure if a device is lost.
- Secure file storage: Uploaded images, voice messages, and documents should be stored in the app's sandboxed storage directory, not on external/shared storage where other apps could access them.
- Session token management: Authentication tokens should have short expiration windows (1-24 hours) with automatic refresh. Never store long-lived tokens in SharedPreferences or UserDefaults without encryption.
Compliance Requirements by Industry
| Regulation | Applies To | Key SDK Requirements |
|---|---|---|
| GDPR | EU users | Consent collection, data export, right to deletion, data minimization |
| HIPAA | US healthcare | BAA with vendor, audit logging, access controls, encrypted PHI |
| SOC 2 | SaaS / enterprise | Access controls, monitoring, incident response, change management |
| CCPA | California users | Opt-out of data sale, data disclosure, deletion rights |
| PCI DSS | Payment data | Never store card numbers in chat, tokenize payment flows |
App Store Security Requirements
Both Apple and Google enforce security standards for apps that handle user data:
- Apple App Store: Apps must declare all data collection in the Privacy Nutrition Label. Declare the chat SDK's data collection accurately, including messages, contact details and files.
- Google Play: The Data Safety section requires disclosure of all data types collected, stored, and shared. SDKs that phone home to undisclosed third-party domains trigger rejection. Ensure your chat SDK's data flow is fully documented.
Security Best Practices for Implementation
- Protect API keys. Anything shipped in an app can be extracted, so use keys scoped to what the app needs, keep them out of source control, and rotate them if exposed.
- Implement certificate pinning. Prevent man-in-the-middle attacks by pinning your chatbot server's SSL certificate in the SDK configuration.
- Audit third-party dependencies. Run
npm audit(React Native),flutter pub deps(Flutter), or dependency scanning tools to ensure no SDK dependency has known vulnerabilities. - Gate sensitive chat history behind your app's own login or biometric check (Face ID, Touch ID, Android BiometricPrompt) in healthcare and finance apps.
- Log redaction: Ensure chat logs sent to your analytics platform redact PII (email addresses, phone numbers, card numbers) before transmission.
Security is a differentiator. When enterprise clients evaluate chat SDKs, the security documentation and compliance certifications often outweigh feature comparisons. Invest in getting it right from the start, and it becomes a competitive advantage rather than a last-minute scramble. The OWASP Mobile Top 10 provides a comprehensive framework for identifying and mitigating mobile security risks that apply directly to chat SDK implementations. For platforms that handle security out of the box, see our no-code chatbot builder comparison. If your use case involves customer support workflows, the customer support chatbot guide covers how to configure secure handoff and data retention policies across channels.
SDK Features That Matter in Real Apps
Offline Message Queuing
When the user loses connection (a train tunnel, airplane mode, weak signal), messages queue locally and send when the connection returns, so nothing typed is lost.
Live Agent Handover
When the bot cannot help, a person from your team takes over in the same chat screen. Your agents reply from the Conferbot inbox, alongside website and messaging conversations, and the user sees typing indicators while they write. See our human handoff guide.
Push Notifications
When an agent replies while the app is in the background, the user gets a push notification (FCM on Android, APNs on iOS) and can tap straight back into the chat.
File Uploads
Users can send images and documents, for example a screenshot of an error or a photo of a damaged product, using the platform's native pickers.
Theming
- Android: Material Design 3 with automatic dark theme
- iOS: colours, fonts and avatars, with automatic light and dark mode
- Flutter and React Native: customisable widgets and components
Match your app's palette and typography so the chat feels like part of the app.
Open Source SDKs on GitHub
- conferbot-android - Kotlin, XML Views and Jetpack Compose
- conferbot-ios - Swift, UIKit and SwiftUI
- conferbot-flutter - Dart
- conferbot-react-native - TypeScript
Accessibility
Check the chat with VoiceOver on iOS and TalkBack on Android, keep tap targets at least 44 by 44 points (Apple's guideline) or 48 by 48 dp (Android's), and meet WCAG contrast of 4.5:1 for body text. Test with your own theme applied, since custom colours can break contrast.
Was this article helpful?
Build and deploy in 10 minutes. No coding needed.
How to Add a Chatbot to Your Mobile App FAQ
Everything you need to know about chatbots for how to add a chatbot to your mobile app.
About the Author
The Conferbot team writes about building, deploying, and improving AI chatbots.
View all articles