OnebearChat class
Public facade — see docs/superpowers/specs/2026-08-31-mobile-chat-sdk-design.md §2 for
the full design rationale this mirrors from the native (Swift/Kotlin) SDKs.
v1 wraps the Android native SDK only (sdk/android). Calling any method before an iOS
implementation exists throws UnimplementedError on iOS — this plugin's pubspec.yaml
deliberately declares only the android platform, so flutter pub get in an iOS-targeting
app fails fast at build time instead of at runtime.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
-
events
→ Stream<
OnebearChatEvent> -
no setter
-
unreadCount
→ Stream<
int> -
Badge the host app's own UI (e.g. a tab icon) with this — there is no built-in floating
launcher on mobile, unlike the web widget (see the design spec's §2 rationale).
no setter
Static Methods
-
configure(
{required String publicKey, required String apiBaseUrl}) → Future< void> -
Must be called before any other method.
apiBaseUrlis the OneBear API origin (e.g.https://app.onebear.example) — required here because, unlike the web widget, there is no<script src>to infer it from. -
identify(
OnebearIdentity identity) → Future< void> -
userHashmust be computed by the customer's own backend — see OnebearIdentity. -
logout(
) → Future< void> - Erases all local state (session, visitor token, unread count, pending messages, push registration). Call on sign-out.
-
present(
) → Future< void> - Presents the chat full-screen. Always full-screen in v1 — see the design spec's §2 rationale.
-
setCustomFields(
Map< String, String> fields) → Future<void> -
setLanguage(
String language) → Future< void>