Microsoft Bot Framework Integration for Mobile Apps

Integrating Microsoft Bot Framework into a Mobile App: NLP in Practice Suppose you have a mobile app that needs to communicate with users in natural language — understand commands and respond across channels. If you build NLP from scratch, it will take six months and a budget comparable to a team

Development and support of all types of mobile applications:

Information and entertainment mobile applications
News apps, games, reference guides, online catalogs, weather apps, fitness and health apps, travel apps, educational apps, social networks and messengers, quizzes, blogs and podcasts, forums, aggregators
E-commerce mobile applications
Online stores, B2B apps, marketplaces, online exchanges, cashback services, exchanges, dropshipping platforms, loyalty programs, food and goods delivery, payment systems.
Business process management mobile applications
CRM systems, ERP systems, project management, sales team tools, financial management, production management, logistics and delivery management, HR management, data monitoring systems
Electronic services mobile applications
Classified ads platforms, online schools, online cinemas, electronic service platforms, cashback platforms, video hosting, thematic portals, online booking and scheduling platforms, online trading platforms

These are just some of the types of mobile applications we work with, and each of them may have its own specific features and functionality, tailored to the specific needs and goals of the client.

Showing 1 of 1All 1734 services
Microsoft Bot Framework Integration for Mobile Apps
Medium
~3-5 days

Our competencies:

Frequently Asked Questions

Latest works

  • image_mobile-applications_feedme_467_0.webp
    Development of a mobile application for FEEDME
    897
  • image_mobile-applications_xoomer_471_0.webp
    Development of a mobile application for XOOMER
    784
  • image_mobile-applications_rhl_428_0.webp
    Development of a mobile application for RHL
    1218
  • image_mobile-applications_zippy_411_0.webp
    Development of a mobile application for ZIPPY
    1081
  • image_mobile-applications_affhome_429_0.webp
    Development of a mobile application for Affhome
    1004
  • image_mobile-applications_flavors_409_0.webp
    Development of a mobile application for the FLAVORS company
    600

Integrating Microsoft Bot Framework into a Mobile App: NLP in Practice

Suppose you have a mobile app that needs to communicate with users in natural language — understand commands and respond across channels. If you build NLP from scratch, it will take six months and a budget comparable to a team of three developers. Microsoft Bot Framework v4 and Azure Bot Service provide a ready-made infrastructure: a dialog engine, integration with dozens of channels (Teams, Telegram, web), and a built-in NLP component CLU. However, integrating into a mobile app requires understanding architectural nuances. Let's break down the key points: Direct Line, tokens, dialog state, and avoiding Adaptive Cards. This saves up to 40% of the budget compared to custom development.

How to Securely Connect a Mobile App to Azure Bot Service?

Direct Line is the only channel for custom mobile clients (see Direct Line Protocol). The mistake we've seen in dozens of projects: developers hardcode DirectLineSecret into the app code. After reverse engineering the APK or IPA, the secret becomes public. This allows attackers to send requests on behalf of the bot. The solution is tokenization: the server generates a temporary token via /v3/directline/tokens/generate and passes it to the client. The token lives 30 minutes and can be refreshed via /v3/directline/tokens/refresh. Example in Swift:

// iOS: obtaining a token from the server and initializing a Direct Line session func startBotSession() async throws -> String { let tokenResponse = try await authService.getDirectLineToken() UserDefaults.standard.set(tokenResponse.conversationId, forKey: "botConversationId") return tokenResponse.token } 

Microsoft documentation confirms: The Direct Line token is valid for 30 minutes. You can obtain a new token from the /v3/directline/tokens/refresh endpoint.

Architectural integration diagramFor deployment, use Azure Web App with integration of Direct Line, CLU, and CosmosDB. Typical architecture: mobile app → Direct Line → Bot Framework SDK → CLU for NLP → CosmosDB for state storage.

LUIS or CLU: Which to Choose for a New Project?

Bot Framework traditionally used LUIS for intent recognition. But Microsoft has migrated to CLU (Conversational Language Understanding) as part of Azure AI Language. CLU works twice as fast as LUIS, supports 50+ languages, and better recognizes complex dialogs with context. If you're starting a new project — choose CLU. For existing LUIS projects, prepare for migration: the export formats and SDKs differ (Azure.AI.Language.Conversations instead of Microsoft.Azure.CognitiveServices.Language.LUIS). We have helped clients migrate five projects in recent years.

Feature LUIS CLU
Recognition speed 200–400 ms 80–200 ms (up to 2× faster)
Supported languages ~10 50+
Integration with Bot Framework Direct via Recognizer Via CustomQuestionAnsweringRecognizer
Model training Requires export from LUIS Built-in import from .LU files

Switching to CLU saves 30–40% of transaction costs and 40% of development time. Get a consultation from our engineer to evaluate the benefits for your project.

Storing Dialog State in Production

By default, Bot Framework stores UserState and ConversationState in memory. After a server restart, context is lost. For production, we use CosmosDbPartitionedStorage or BlobStorage. Configuration example in C#:

var storage = new CosmosDbPartitionedStorage(new CosmosDbPartitionedStorageOptions { CosmosDbEndpoint = configuration["CosmosDb:Endpoint"], AuthKey = configuration["CosmosDb:AuthKey"], DatabaseId = "BotStorage", ContainerId = "DialogState" }); var userState = new UserState(storage); var conversationState = new ConversationState(storage); 

This ensures context preservation even when scaling to 1000+ simultaneous dialogs. If you have questions about setting up CosmosDB, contact us — we'll help.

Protocol Choice: WebSocket vs Polling

Direct Line supports two message retrieval modes: long polling (REST) and WebSocket. Let's compare key metrics.

Feature Long Polling (REST) WebSocket (streamUrl)
Delivery latency 500 ms – 2 s 50–150 ms
Server load High (frequent requests) Low (single connection)
Mobile battery consumption Higher (frequent wake-ups) Lower (persistent TCP)
Implementation complexity Simple (HTTP) Medium (connection management)

WebSocket is preferable for active chat. On Android use OkHttp WebSocket, on iOS use URLSessionWebSocketTask. An important nuance: streamUrl lives about 60 seconds without activity, after which the connection closes. You need to handle onClosed and reconnect with a refreshed token.

Limitations of Adaptive Cards for Mobile UI

Adaptive Cards are a JSON schema for UI cards that Bot Framework uses for multi-channel rendering. There are official SDKs for iOS and Android (AdaptiveCards-iOS, adaptivecards-android), but style customization is limited: you cannot override fonts, margins, or animations. In 80% of our projects, we abandon Adaptive Cards in favor of custom event activities that render UI natively. This gives full control over design and behavior — for example, you can embed interactive forms or graphics.

What’s Included in a Turnkey Integration

  • Architectural documentation (Direct Line scheme, dialog diagram)
  • Repository with bot code and SDK for iOS/Android
  • Access to Azure resources (Bot Service, CLU, CosmosDB)
  • Deployment instructions via CI/CD and monitoring (Application Insights)
  • Team training (2 hours online with typical error analysis)
  • Compatibility guarantee with iOS 15+ and Android 12+

We have been working with Bot Framework v4 since its first release. We'll evaluate your project in one day — just write to us in the chat on the website.

Work Process

  1. Analysis: audit current chat scenarios, gather requirements.
  2. Design: choose stack (CLU/LUIS), design dialogs, Direct Line architecture.
  3. Development: implement bot in C# (.NET) or TypeScript, create mobile client with WebSocket support.
  4. Testing: Bot Framework Emulator for unit tests, load testing at 500+ RPS.
  5. Deployment: Azure Web App with auto-scaling, setup monitoring and alerts.

Timeline Estimates

Integration with an existing Azure Bot — 3–5 days. Development from scratch (including CLU model, dialog logic, Azure infrastructure, and mobile client) — 2–4 weeks.

Request a consultation — we'll show you how to save up to 40% of your chatbot development budget.