--- title: "ऐप ब्रिज: एक आखिरी अपडेट | Busymate AI" description: "अपने iOS या Android ऐप में फ़्रोज़न kit v2 ब्रिज एक बार इंस्टॉल करें; आगे का हर सुधार हमारी ओर से आता है, और स्टोर में मौजूद ऐप काम करते रहते हैं।" last_updated: "2026-09-24T08:24:53+03:00" --- # ऐप ब्रिज: एक आखिरी अपडेट | Busymate AI Source: https://busymate.ai/hi/docs/guides/app-bridge-v2 Last modified: 2026-09-24T08:24:53+03:00 Busymate AI runs inside a mobile app through one small file: the app bridge. Kit v2 is the last version of that file you ship. After it, every fix and every new feature comes from our side, and your app never needs a new build because of us. Why it is the last one: - **The file in your app is a pipe.** It carries one JSON message between the chat and five fixed operations in your app: `hello`, `state`, `mint`, `open` and `action`. It holds no message names, timings, retries or fallbacks, so there is nothing in it for us to fix later. - **Everything else is served.** The chat, the embed loader and the sign-in logic load from busymate.ai each time, so an improvement reaches your customers on their next launch. - **New abilities are opt-in.** The bridge says what it supports when it starts, and the chat uses only what was announced. An older bridge keeps working as it is. - **The files never change under the same address.** Everything at `https://busymate.ai/sdk/v2/2.0.0/` stays exactly as it is. A new version would get a new address, announced well in advance. The full message contract is published beside the files, at `https://busymate.ai/sdk/v2/2.0.0/CONTRACT.md`. ## 1. Know what the bridge can do - `hello` reports the bridge version, the platform, the WebView version, your app build and the assistant it was installed for. - `state` says whether someone is signed in, with a scrambled account key. Your user id never leaves the device. - `mint` asks your backend for a short-lived sign-in token. Your code gets what the chat sent (a `nonce` to sign) plus `assistant` and `origin`, which the bridge sets itself so a page can never choose them. - `open` opens an `https` link in the system browser. Any other link is refused. - `action` hands a named action, such as `close`, to your app. Anything you do not handle is ignored. The bridge also tells the chat when your app returns to the foreground, and when it reloaded the chat after the system stopped the web view. Only your own chat can reach it: exactly `https://.busymate.ai` and the exact `https` origins you list. There are no wildcards, so another company's chat, a shared artifact or any other busymate.ai page opened inside your app is refused, and your backend is never asked. List only hosts that serve the chat itself. ## 2. Install it on Android Copy `BusymateBridge.kt` from the address above into your project and check its SHA-256 against `SHA256SUMS` in the same folder. Remove the kit v1 bridge (`BusymateAIWebViewBridge`, the `BusymateAINative` and `SupportChatNative` JavaScript interfaces) and any copied `native-identity.js` or `wire.js`. Then install the bridge before the first `loadUrl`, and forward renderer crashes so the chat recovers instead of the app closing: ```kotlin // Copy https://busymate.ai/sdk/v2/2.0.0/android/BusymateBridge.kt (check SHA256SUMS). // Needs androidx.webkit:webkit >= 1.8 and androidx.lifecycle:lifecycle-process. BusymateBridge.install(webView, BusymateBridge.Config( assistant = "your-assistant", origins = emptyList(), account = { session.userIdOrNull }, // null when signed out mint = { request, done -> // YOUR backend signs; never a key in the app backend.mintBusymate(request["nonce"] as String) { token, nonce -> done(if (token != null) BusymateBridge.MintResult.Token(token, nonce) else BusymateBridge.MintResult.Failed) } }, )) // In your WebViewClient: the chat recovers instead of the app closing. override fun onRenderProcessGone(view: WebView, detail: RenderProcessGoneDetail) = BusymateBridge.onRenderProcessGone(view, detail) // Optional, only faster: after sign-in, sign-out or an account switch. BusymateBridge.accountChanged() ``` ## 3. Install it on iOS Copy `BusymateBridge.swift` (iOS 14 or later) and check its SHA-256. Remove the old `BusymateAI` and `SupportChat` message handlers. Install the bridge before the first `load`, and forward web content crashes from your navigation delegate: ```swift // Copy https://busymate.ai/sdk/v2/2.0.0/ios/BusymateBridge.swift (iOS 14+, check SHA256SUMS). BusymateBridge.install(on: webView, config: .init( assistant: "your-assistant", origins: [], account: { Auth.shared.userId }, // nil when signed out mint: { request in // YOUR backend signs; never a key in the app guard let pair = try await Backend.mintBusymate(nonce: request.nonce) else { return nil } return .init(token: pair.token, nonce: pair.nonce) })) // In your WKNavigationDelegate: the chat reloads and restores itself. func webViewWebContentProcessDidTerminate(_ webView: WKWebView) { BusymateBridge.contentProcessDidTerminate(webView) } // Optional, only faster: after sign-in, sign-out or an account switch. BusymateBridge.accountChanged() ``` If your app sets `WKAppBoundDomains`, add the assistant's domains to that list, or the bridge cannot be reached. ## 4. Configure your website Keep the embed script. Tell it who is signed in on your website and how to get a fresh token from your backend, and delete any page script that talked to the app directly. `account()` is your website's own session: inside your app's WebView it returns `null`, and the chat then asks the app itself, so one web bundle serves both: ```html ``` React Native, Flutter and Electron apps use the matching file from the same folder: `react-native/busymateBridge.js` with `core/busymateBridgeCore.js`, `flutter/busymate_bridge.dart`, or `electron/preload.js` with `electron/main.js`. Each takes the same `account` and `mint` callbacks. For these, load the hosted chat page directly rather than a page that embeds it. ## 5. Keep your backend as it is Your signer keeps producing ES256 tokens with `nonce` and `jti` that expire within 120 seconds. In the app it signs the `nonce` the bridge passes; on your website `getIdentity` receives `{ nonce }` as well, and you may sign that one or your own. See [Sign identity tokens from your backend](https://busymate.ai/hi/docs/guides/identity-backend-signing). For app review: the bridge asks for no new permissions and downloads no code. The chat can reach only your own sign-in token, an `https` link and close. Mention chat data shared with Busymate AI in your privacy label; the AI disclosure and the report control are shown inside the chat. ## Verify 1. Signed out, open the chat: a guest chat that answers. 2. Sign in inside your app: the same conversation shows your customer's name, with no reload. 3. Put the app in the background for a minute, then bring it back: the same conversation, and no "That chat had ended". 4. Switch accounts: the first person's conversation disappears and the second person is recognized. 5. Sign out: the chat goes back to a guest. Every session records which bridge version it came through and whether the customer was recognized, so we can tell you how each build of your app is doing without access to your code. ## How we prove it before you see it We keep our own reference apps, built from the exact files at the address above, and run the same cases on them that you would: first launch signed out and signed in, signing in while the chat is open, switching accounts, signing out, the app in the background and restarted, the web view crashing, a slow or silent sign-in on your side. They run on real Android phones, both loading the chat page directly and loading a website that embeds it, and in real browsers: Chromium (the engine behind Chrome), Chromium with third-party cookies blocked, and the WebKit engine Safari uses. Each case must show the right person, never "That chat had ended", and a working guest chat when nobody can be recognized. Sessions recorded from every bridge version we know is in the stores, and from apps with no bridge at all, are replayed against each change. The run happens before every change to how the chat recognizes people goes live, again right after, and every night. A failure stops the change and alerts us; it never waits for one of your customers to find it. ### Do I have to update again later? No. This file does not change. If a new capability ever needs something new in your app, it arrives as a new, optional version announced well in advance, and the version you shipped keeps working. ### What happens to app builds that still ship the old bridge? They keep working. We never switch an old version off, we test every bridge version still in the stores on each update, and a customer who cannot be recognized still gets a working guest chat. ### Is my user id sent to Busymate AI? No. The bridge sends a scrambled key made from your app id and the user id, only so the chat can tell that the person changed. The token your backend signs carries the id you choose to put in it.