Руководства
Нативные SDK для iOS, Android и десктопа
Покажите чат ассистента внутри приложения для iOS, Android или десктопа, передавайте вход через свой бэкенд и узнайте, что требует релиза приложения.
На этой странице
Put Busymate AI chat inside a native app with an official, versioned SDK for iOS, Android, macOS, Windows, Linux, Electron or Tauri. Every platform has its own public repository, and your authenticated backend supplies the customer's identity. This page holds what the platforms share; each platform guide holds only what differs.
1. Choose your platform
- iOS: a Swift package for UIKit and SwiftUI.
- Android: a Gradle source module for Activities and WebViews.
- macOS, Windows, Linux, Electron and Tauri: one guide, one section per platform.
Pin distribution 1.0.5 on iOS, Android and the desktop SDKs. Identity uses protocol v2 (frozen bridge build 2.0.0) and the microphone uses protocol v1. The iOS microphone adapter is 1.0.1, the Android one is 1.0.2, and the macOS, Windows, Linux, Electron and Tauri adapters are 1.0.0. Android 1.0.5 also ships BusymateFiles (the chat's attach button) and iOS 1.0.5 a camera-key check; see each platform guide. These numbers describe different components, so do not compare them.
2. Which changes ship with your app
Hosted chat improvements reach your customers from the service, with no release of yours. These changes need a new build of your app:
- upgrading the SDK to a new distribution;
- adding an OS declaration, such as a microphone usage string or manifest permission;
- adopting a new native capability.
Branding, knowledge, tools, voice availability and human handoff are workspace settings, so they never need a release. Locale and appearance follow the supported hosted chat parameters; the SDKs add no native flags for them.
3. Load the chat
Load the chat URL supplied for your mate and keep its supported query parameters. Set the channel that matches the platform:
| Platform | Channel | Where the chat sits |
|---|---|---|
| iOS | channel=ios | In your WKWebView. |
| Android | channel=android | In your WebView. |
| Desktop SDKs | channel=desktop_sdk | As the window's top-level page. |
Use desktop_sdk for every desktop window. channel=embed is for a chat iframed inside a web page and refuses to start without an allowed parent page. channel=desktop is reserved for the Busymate AI desktop app. A channel parameter alone never identifies a customer.
Allow only exact HTTPS origins, with no wildcards. The SDK adds your mate's own origin. Add https://busymate.ai when you load a /chat/w/<assistant> URL, add your mapped support host if you have one, and include the frame origin when your page embeds the chat.
4. Connect your account
The identity token always comes from your backend. The app holds no signing key.
- The SDK asks your
mintcallback for a token for a nonce it supplies. - Your backend signs a fresh ES256 launch token for that nonce, with a unique
jtiand an expiry within 120 seconds. - Return no identity when the customer is signed out, and never cache or log a token.
- Tell the SDK after login, logout and account switches (
accountChanged()or your platform's equivalent). Foreground resume is observed for you. - Configure
onCloseto dismiss your chat view, and leave it unset when host dismissal is disabled.
See backend signing for the endpoint and Recognize signed-in customers for the whole flow. Existing v1 integrations keep working; they are compatibility paths, not install instructions for a new app (see native bridge compatibility).
5. Enable the microphone
Declare the OS microphone permission where your platform needs one, and install the microphone adapter once before the first load. The first mic or voice tap sends busymate.microphone.v1.request with a correlated id and a source of dictation or voice. The adapter asks the OS and replies with the same id and a granted boolean. Chat waits for that reply before it captures audio or mints a voice token.
Opening the chat never asks for permission. Denial, cancellation and timeout stop activation, and a delayed grant cannot start a cancelled session. After the customer changes the permission in system settings, they tap again. The adapter grants audio only, and only to an allowed origin.
The adapter ships inside each SDK. Every SDK release on GitHub also attaches its source with a checksum file, and each platform guide links the exact files.
6. Artifacts and versions
The identity contract is the frozen bridge contract v2. Its CONTRACT-v2.md hashes to c891b8bae48c87d5ae901de16df0594ba3879dd84ecd535e79120761d4220c1d, the entry in https://busymate.ai/sdk/v2/2.0.0/SHA256SUMS. Each repository's release-manifest.json pins its source hashes, and a change to those bytes is always a new SDK version.
7. Run the demo apps
Each repository's example-app/ has a settings screen for the chat URL, locale, assistant, exact origins, account, backend endpoint, microphone and action callbacks, plus guest and account controls and an event log that never shows credentials. Guest chat needs no fake identity. Authenticated cases need your real backend, and provider availability depends on your workspace.
The chat handles its own composer keyboard inset, so avoid extra native keyboard padding. Keep the chat host out of any proxy or VPN tunnel that would loop traffic, and test safe areas and audio routing in your host app.
Verify
- Build the demo app, open chat signed out and send a guest message.
- Load
?channel=desktop_sdk&locale=deon a desktop SDK: the first frame is in German and fills the window. - Connect your backend, sign in and switch accounts; customer history must not cross accounts.
- On a physical device or real machine, tap dictation and voice separately. Test first grant, denial, retry after changing the OS setting, and cancellation while the prompt is open.
- Test external links, close, background and resume, and renderer recovery.
- Enable handoff in your workspace, request a human and check the Inbox.
Next steps
- Install the iOS SDK — the Swift package for iPhone and iPad.
- Install the Android SDK — the Gradle module for Android.
- Install a desktop SDK — macOS, Windows, Linux, Electron and Tauri.
- Recognize signed-in customers — pass your user's identity to the chat.
Вопросы
Which SDK should a new app install?
The one for your platform: every SDK at distribution 1.0.5.
Where does the identity token come from?
Your authenticated backend signs it for the current request. The app contains no signing key.
Can I start with guest chat?
Yes, when your workspace permits guest access. Add identity once your backend is ready.
Do hosted updates replace app releases?
No. Hosted chat improvements arrive from the service, while SDK upgrades, OS declarations and new native capabilities need your own release.