Microsoft Bot Framework NLP Integration in Mobile Chatbot

NOVASOLUTIONS.TECHNOLOGY is engaged in the development, support and maintenance of iOS, Android, PWA mobile applications. We have extensive experience and expertise in publishing mobile applications in popular markets like Google Play, App Store, Amazon, AppGallery and others.
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 1 servicesAll 1735 services
Microsoft Bot Framework NLP Integration in Mobile Chatbot
Medium
~3-5 business days
FAQ
Our competencies:
Development stages
Latest works
  • image_mobile-applications_feedme_467_0.webp
    Development of a mobile application for FEEDME
    756
  • image_mobile-applications_xoomer_471_0.webp
    Development of a mobile application for XOOMER
    624
  • image_mobile-applications_rhl_428_0.webp
    Development of a mobile application for RHL
    1052
  • image_mobile-applications_zippy_411_0.webp
    Development of a mobile application for ZIPPY
    947
  • image_mobile-applications_affhome_429_0.webp
    Development of a mobile application for Affhome
    862
  • image_mobile-applications_flavors_409_0.webp
    Development of a mobile application for the FLAVORS company
    445

Microsoft Bot Framework NLP Integration in Mobile Chatbot

Microsoft Bot Framework v4 + Azure Bot Service isn't just NLP, it's a dialog management platform with support for dozens of channels. If your bot needs to work in Teams, Telegram, web chat, and mobile app simultaneously — this is architecturally sound. If you only need mobile — the framework overhead might be excessive.

Where Problems Most Often Arise

Direct Line API. The mobile app connects to Azure Bot Service via Direct Line — a special channel for custom clients. Common mistake: using DirectLineSecret directly in the mobile app. Never do this — the secret is compromised via APK reverse-engineering. Correct approach: backend generates a temporary token via /v3/directline/tokens/generate and gives it to the client. Token lives 30 minutes, refreshable via /v3/directline/tokens/refresh.

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

LUIS vs CLU. Bot Framework traditionally used LUIS (Language Understanding) for intent recognition. Microsoft is migrating LUIS to Conversational Language Understanding (CLU) under Azure AI Language. For new projects — choose CLU; LUIS is being deprecated. For existing LUIS integration — note that CLU uses different export formats and different SDK (Azure.AI.Language.Conversations).

State Management. Bot Framework stores dialog state in BotState (UserState, ConversationState). By default — in memory, meaning context loss on server restart. In production use CosmosDbPartitionedStorage or BlobStorage:

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);

Adaptive Cards in Mobile Client

Bot Framework supports Adaptive Cards — JSON schema for describing UI cards. Convenient for multi-channel bots: one card renders in Teams, web chat, and your mobile app. Official SDKs exist for iOS and Android (AdaptiveCards-iOS, adaptivecards-android), but style customization is limited — card design doesn't always fit app UI.

In practice, for mobile apps it's often simpler to handle custom activity with type event and render UI natively, ignoring Adaptive Cards.

Direct Line WebSocket vs Polling

Direct Line supports two message retrieval modes: long polling (/v3/directline/conversations/{id}/activities) and WebSocket (streamUrl from session creation response). WebSocket is preferable — reduces latency and server load. On Android — OkHttp WebSocket; on iOS — URLSessionWebSocketTask.

Important: streamUrl lives ~60 seconds without activity, then closes. Handle onClosed and reconnect with refreshed token.

Development Process

Registering Azure Bot Service, setting up Direct Line channel.

Developing bot logic in C# (.NET) or JavaScript/TypeScript (Bot Framework SDK v4).

Integrating CLU/LUIS for intent recognition.

Mobile client: Direct Line token exchange, WebSocket connection, message UI.

Testing via Bot Framework Emulator before Azure deployment.

Timeline Estimates

Integrating with a ready Azure Bot — 3–5 days. Development from scratch including CLU model, dialog logic, Azure infrastructure, and mobile client — 2–4 weeks.