Guides
Mobile SDKs
Hand-crafted iOS, Android, Flutter, and React Native clients.
Four hand-crafted Tier 1 SDKs that share an identical API shape — once you've learned one, you know the others. Each lives at sdks/<platform>/ in the monorepo.
iOS — Swift
// Package.swift
.package(url: "https://github.com/singlink/singlink-ios", from: "0.1.0")import AskAIs Customer Service
let client = SingChatClient(baseUrl: URL(string: "https://cs.askais.com")!)
let id = try await client.identify(.init(appId: "ws_abc", email: "ada@example.com"))
try await client.startRealtime { event in
if case .messageNew(let msg) = event { print(msg.content) }
}Android — Kotlin
// build.gradle.kts
implementation("app.singchat:sdk:0.1.0")import app.singchat.sdk.SingChatClient
import app.singchat.sdk.models.IdentifyRequest
val client = SingChatClient("https://cs.askais.com")
client.identify(IdentifyRequest(appId = "ws_abc", email = "ada@example.com"))
client.startRealtime()
client.events.collect { event -> /* ... */ }Flutter — Dart
# pubspec.yaml
dependencies:
singlink_sdk: ^0.1.0import 'package:singlink_sdk/singlink_sdk.dart';
final client = SingChatClient('https://cs.askais.com');
await client.identify(IdentifyRequest(appId: 'ws_abc'));
client.startRealtime();
client.events.listen((e) { /* ... */ });React Native — TypeScript
npm install @singlink/react-nativeimport { useAskAIs Customer Service } from "@singlink/react-native";
const { client, identity, lastEvent } = useAskAIs Customer Service({
baseUrl: "https://cs.askais.com",
identify: { appId: "ws_abc", email: user.email },
});Shared design
- One
SingChatClientper app (or per workspace if multi-tenant in same binary) identify()returns JWT, contact, and WS URL- WebSocket auto-reconnects with exponential backoff, 25 s ping
- Events surface as a typed enum / sealed class — no string matching needed
- Errors are typed (
SingChatError/SingChatException)
Roadmap (mobile UI components)
The current SDKs are logic-only — bring your own chat UI. A pre-built chat view in SwiftUI, Jetpack Compose, Flutter widgets, and React Native components is on the roadmap.