The base chat SDK stays permission-free while selected hosts opt into APNs, FCM or native conversation voice.
Choose a capability explicitly
Chat and the native widget are the base capabilities. Mobile SDK 0.4.0 adds optional conversation voice for direct human WebRTC calls and AI-to-human handoff. iOS hosts link the separate `DobroDeskVoiceConversation` product. Android hosts add `com.dobrodesk:dobrodesk-voice:0.4.0` from the bundle's local Maven repository. The existing AI-only `DobroDeskVoice` path remains separate. The four framework wrappers expose `client.attachNativeConversationVoice()` after the host installs the optional native factory. A custom or headless client can inject `DobroDeskVoiceConversationPort` with `attachConversationVoice(port)`. The base chat packages do not link WebRTC or request microphone permission. The public release asset is https://github.com/comstud-io/dobrodesk-mobile-sdk/releases/download/v0.4.0/dobrodesk-mobile-sdk-0.4.0-bundle.tar.gz.
Keep voice and push opt-in. The host declares microphone permission, supplies Android's runtime permission requester and installs the native voice factory. The SDK requests microphone access only after the customer chooses a voice action and stops calls when the widget is hidden or the app leaves the foreground. AI usage consent and human-call recording consent are separate. The visitor SDK does not dial PSTN numbers, include CallKit integration or support background calling.
// Register the extracted bundle's native/maven directory in host settings first.
dependencies {
implementation("com.dobrodesk:dobrodesk-voice:0.4.0") // optional
// implementation("com.dobrodesk:dobrodesk-push:0.4.0") // optional
}Choose who delivers push
In Settings > Channels > Mobile push, select Off when your app does not need support notifications. Select Use my app's delivery when your backend already delivers push. Select DobroDesk manages delivery when DobroDesk should send through APNs or FCM. Only delivery managed by DobroDesk requires provider credentials in DobroDesk. Switching delivery mode retains saved credentials and does not grant notification permission on the device. Off disables delivery by DobroDesk. Your own backend controls delivery and opt-out for notifications it sends, and existing webhook subscriptions stay active.
For delivery through your app, register device tokens with your authenticated backend and subscribe it to the signed message.created webhook. Verify the signature and workspaceId. Accept only public outbound replies using data.direction, data.visibility and data.authorKind, then deduplicate using the event id.
The event identifies data.conversationId, data.messageId and data.customerId. It does not include an integration ID, account scope, session ID or message text. Resolve account, integration, session and conversation scope from your own authenticated registration mapping before choosing a token. Matching a customer across the whole workspace is insufficient. Send a generic notification without reply text.
Use the published typed client event hook (`client.events` in Flutter or `client.subscribe(...)` in JavaScript wrappers) while the app and native client are active. Handle `snapshot` in your own in-app conversation UI.
The hook emits `snapshot` after the client starts or resumes a session or after you explicitly call `client.refresh()` or `client.waitForAssistant()`. The host owns any DobroDesk APNs or FCM callback and decides whether to call `client.refresh()` or update its own UI. Use the signed `message.created` webhook to drive your app's background delivery.
This is a foreground refresh signal, not a continuous realtime watcher or unread event. It does not schedule local notifications or request notification permission.
A callback running inside the app cannot receive a future reply after the app stops. Let your backend deliver the notification through APNs or FCM. Do not keep the app polling in the background.
The mobile SDK exposes an opt-in push facade. Attach the platform PushPort with `client.attachPush(...)` and provide the optional registration adapter when DobroDesk-managed registration is enabled. Set the authenticated context before `requestPermissionAndRegister()`. The facade validates incoming payload scope and emits only matching `payload` events. On a scoped `payload`, the host can call `client.refresh()` and use the resulting `snapshot` for active UI. It does not add Firebase, schedule local notifications or run background retries. Native permission, device-token hooks and notification opening remain host-owned. Delivery follows the selected Off, External or Managed mode.
Keep push registration outside the base SDK
Register the device token with your authenticated provider flow and bind it to the verified DobroDesk account or session. Rotate tokens, remove them on logout and let the server discard invalid provider tokens. Keep notification payloads limited to the documented identifiers. Do not place reply text, customer messages or credentials in a push payload.
The base client does not import Firebase and does not create an APNs or FCM registration. A host that does not need push should not request notification permission or include the optional artifact.
Keep voice permission and cleanup explicit
Install the optional voice factory once from host setup. iOS uses `DobroDeskOptionalVoiceWidget.install(realtimeOrigin:)` after linking `DobroDeskVoiceConversation`. Android uses `installOptionalVoiceFactory(webSocketOrigin:permissionRequester:)` from the host. The iOS host adds `NSMicrophoneUsageDescription`. The Android host declares `android.permission.RECORD_AUDIO` and provides its Activity permission requester.
The widget asks for microphone permission only after the customer chooses an AI or human voice action. The signed session controls which voice actions are available. Human calls can remain available while AI voice is off. When the saved recording policy asks for a choice, collect the customer's choice before starting a human call. The widget stops the call when it is hidden or the app leaves the foreground. No background calling service is included.
Dispose the attached voice facade during wrapper logout or replacement. Unsubscribe conversation listeners and ignore late callbacks after close, reset or account change. If the native voice capability is unavailable or permission is denied, explain the state and leave the chat available.
Attach conversation voice after native setup
After the host installs the optional native factory, call `attachNativeConversationVoice()` on the Flutter, React Native, NativeScript or Capacitor client. This returns the native conversation voice facade for direct human calls and AI-to-human handoff. A custom or headless host can instead supply a `DobroDeskVoiceConversationPort` to `attachConversationVoice(port)`. Keep `attachVoice(port)` for the existing AI-only voice capability.
The conversation facade exposes `startHumanCall(options)`, `requestHumanHandoff(options)`, cancellation and retry methods, `endHumanCall()`, paged call history and transcript reads. `DobroDeskHumanVoiceOptions.recordingConsent` must come from the customer's explicit recording choice when the saved policy requests it. The native widget handles this choice when the customer uses its built-in voice controls. In Flutter, listen to `voice.conversationEvents`. The JavaScript wrappers provide `voice.subscribeConversation(listener)`.
const voice = await client.attachNativeConversationVoice();
const unsubscribe = voice.subscribeConversation(onConversationVoiceEvent);
// On logout or host teardown:
unsubscribe();
await voice.dispose();