Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
53a1661
feat(docs): register uni-app SDK documentation contract
Bloomingg Aug 13, 2026
4c4391e
docs(uniapp): add bilingual setup and lifecycle guides
Bloomingg Aug 13, 2026
1952755
docs(uniapp): document user and relationship APIs
Bloomingg Aug 13, 2026
2f8d1f2
docs(uniapp): document conversation APIs
Bloomingg Aug 13, 2026
6d030e7
docs(uniapp): document group APIs
Bloomingg Aug 13, 2026
a9d84f4
docs(uniapp): document message and upload APIs
Bloomingg Aug 13, 2026
7067d3d
docs(uniapp): document signaling events and diagnostics
Bloomingg Aug 13, 2026
d5608b3
feat(docs): publish uni-app SDK documentation
Bloomingg Aug 13, 2026
07cef87
fix(docs): render UTS examples in production
Bloomingg Aug 13, 2026
0b581cf
docs(uniapp): align core guides with wasm standards
Bloomingg Aug 13, 2026
0b44e46
docs(uniapp): align Chinese SDK pages with wasm
Bloomingg Aug 13, 2026
1d5278e
docs(uniapp): fix union types in markdown tables
Bloomingg Aug 13, 2026
f67e4a5
docs(uniapp): render nullable table types safely
Bloomingg Aug 13, 2026
aac348a
docs(uniapp): align English calling guides with Wasm
Bloomingg Aug 13, 2026
c89d193
docs(uniapp): align English SDK foundations with Wasm
Bloomingg Aug 13, 2026
fd0a1fd
docs(uniapp): align English user guides with Wasm
Bloomingg Aug 13, 2026
1625f9d
docs(uniapp): align English conversation guides with Wasm
Bloomingg Aug 13, 2026
05027c3
docs(uniapp): align English group guides with Wasm
Bloomingg Aug 13, 2026
8e944d7
docs(uniapp): align English message guides with Wasm
Bloomingg Aug 13, 2026
144dda6
fix(docs): render commercial badges in tables
Bloomingg Aug 13, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
9 changes: 6 additions & 3 deletions app/sitemap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ import { getAllRoutes } from '@/src/lib/routes';
import { isSdkPlatformVisible } from '@/src/config/docs';
import { siteConfig } from '@/src/config/site';
import { toLocalizedPath } from '@/src/lib/i18n';
import { getPublishedWasmLocales, isWasmRoute } from '@/src/lib/wasm-publication';
import {
getPublishedClientSdkLocales,
isClientSdkRoute,
} from '@/src/lib/client-sdk-publication';
import { getGuidePagePaths } from '@/src/components/docs/guides-page';

export default function sitemap(): MetadataRoute.Sitemap {
Expand All @@ -22,8 +25,8 @@ export default function sitemap(): MetadataRoute.Sitemap {
)
.flatMap((route) => {
const changeFrequency = 'monthly' as const;
const locales = isWasmRoute(route.path)
? getPublishedWasmLocales(route.path)
const locales = isClientSdkRoute(route.path)
? getPublishedClientSdkLocales(route.path)
: (['en', 'zh'] as const);
return locales.map((locale) => ({
url: new URL(toLocalizedPath(route.path, locale), siteConfig.siteUrl).toString(),
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
title: 'Accept a call'
description: 'OpenIM uni-app / uni-app x SDK guide for Accept a call.'
product: 'sdk'
context: 'chat/sdk/uniapp'
template: 'guide'
status: 'published'
lastUpdated: '2026-08-13'
version: 'v4'
platform: 'uniapp'
sourcePath: '/sdk/uniapp/calling/managing-calls/accept-call'
---

```uts
import { signalingAccept } from '@/uni_modules/unix-openim-sdk'

const roomCredentials = await signalingAccept({ invitation })
```

`signalingAccept()` is <span className="enterprise-field-badge">Commercial</span>. Pass the original `OpenIMSignalingInvitationInfo` received from `onReceiveNewInvitation`; it must retain the room, inviter, invitees, and session type. Do not reconstruct it.

Validate the active SDK session and request microphone or camera permission before accepting. If permission is denied, do not send an accept request; reject the call or explain the failure according to the product flow.

## Result

The Promise resolves to `OpenIMSignalingAcceptResult | null`:

| Field | Type | Description |
| --- | --- | --- |
| `roomID` | `string` or `null` | Media room identifier for this call. |
| `token` | `string` or `null` | Short-lived credential used to join the room. |
| `liveURL` | `string` or `null` | Media service connection address. |
| `invitation` | `OpenIMSignalingInvitationInfo` or `null` | Invitation snapshot returned by the server. |

Keep these values only in memory. Join the media engine only after obtaining a valid `roomID` and `token`. Promise completion, remote signaling events, and an established media connection are separate phases; continue merging state through [call events](/sdk/uniapp/calling/managing-calls/handle-call-events).
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
title: 'Cancel a call invitation'
description: 'OpenIM uni-app / uni-app x SDK guide for Cancel a call invitation.'
product: 'sdk'
context: 'chat/sdk/uniapp'
template: 'guide'
status: 'published'
lastUpdated: '2026-08-13'
version: 'v4'
platform: 'uniapp'
sourcePath: '/sdk/uniapp/calling/managing-calls/cancel-call'
---

```uts
import { signalingCancel } from '@/uni_modules/unix-openim-sdk'

await signalingCancel({ invitation })
```

`signalingCancel()` is <span className="enterprise-field-badge">Commercial</span> and is called by the inviter while the invitation is still unanswered. Pass the complete original `OpenIMSignalingInvitationInfo`; a newly constructed object containing only `roomID` is not sufficient.

Cancellation and hangup have different meanings: cancel an unanswered invitation, and hang up an accepted or connecting session.

Promise success means the cancel signaling request completed. The app must also leave its local waiting state and release media resources that were prepared but not used. The remote side updates through `onInvitationCancelled`. Prevent duplicate actions and resolve cancel/accept races from [call events](/sdk/uniapp/calling/managing-calls/handle-call-events).
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
---
title: 'Handle call events'
description: 'OpenIM uni-app / uni-app x SDK guide for Handle call events.'
product: 'sdk'
context: 'chat/sdk/uniapp'
template: 'guide'
status: 'published'
lastUpdated: '2026-08-13'
version: 'v4'
platform: 'uniapp'
sourcePath: '/sdk/uniapp/calling/managing-calls/handle-call-events'
---

Keep <span className="enterprise-field-badge">Commercial</span> call listeners in one call-state layer. Merge invitation lifecycle, participant connection, and stream changes into the same local state keyed by `roomID`. Every event delivers a raw JSON string; keep the callback short, validate JSON, and then map it to the application's call domain model.

| Event | Purpose |
| --- | --- |
| `onReceiveNewInvitation` | A new call invitation arrived. |
| `onInviteeAccepted`, `onInviteeRejected` | The current invitation was accepted or rejected. |
| `onInvitationCancelled`, `onInvitationTimeout` | The invitation was cancelled or timed out. |
| `onInviteeAcceptedByOtherDevice`, `onInviteeRejectedByOtherDevice` | Another device for the same account handled it. |
| `onHangUp` | A participant ended the call. |
| `onRoomParticipantConnected`, `onRoomParticipantDisconnected` | Room participant connection changed. |
| `onStreamChange` | Participant media stream state changed. |

```uts
import {
off,
onHangUp,
onInvitationCancelled,
onInvitationTimeout,
onInviteeAccepted,
onInviteeAcceptedByOtherDevice,
onInviteeRejected,
onInviteeRejectedByOtherDevice,
onReceiveNewInvitation,
onRoomParticipantConnected,
onRoomParticipantDisconnected,
onStreamChange,
type OpenIMSDKEventSubscription,
} from '@/uni_modules/unix-openim-sdk'

function handleCallPayload(payload : string) {
try {
const value = JSON.parseObject<UTSJSONObject>(payload)
if (value != null) routeValidatedCallEvent(value)
} catch (_) {
console.error('Invalid call event payload')
}
}

const invitationSubscription = onReceiveNewInvitation(handleCallPayload)
const subscriptions : Array<OpenIMSDKEventSubscription> = [
invitationSubscription,
onInviteeAccepted(handleCallPayload),
onInviteeAcceptedByOtherDevice(handleCallPayload),
onInviteeRejected(handleCallPayload),
onInviteeRejectedByOtherDevice(handleCallPayload),
onInvitationCancelled(handleCallPayload),
onInvitationTimeout(handleCallPayload),
onHangUp(handleCallPayload),
onRoomParticipantConnected(handleCallPayload),
onRoomParticipantDisconnected(handleCallPayload),
onStreamChange(handleCallPayload),
]

function removeCallListeners() {
subscriptions.forEach((subscription) => off(subscription))
}
```

This page is the sole complete listener owner for these 11 events. Merge participant state using both room and user IDs; do not rely on event order, display names, or array positions. Deduplicate with the room ID, local session ID, and runtime generation so stale events cannot reopen UI. Call `removeCallListeners()` when the call state layer is destroyed, the user logs out, or the account changes.

HarmonyOS returns a `platform-unsupported` subscription for `onStreamChange` and does not fabricate a stream event. The other signaling events on this page are supported. Never log raw payloads or RTC tokens.
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
title: 'End a call'
description: 'OpenIM uni-app / uni-app x SDK guide for End a call.'
product: 'sdk'
context: 'chat/sdk/uniapp'
template: 'guide'
status: 'published'
lastUpdated: '2026-08-13'
version: 'v4'
platform: 'uniapp'
sourcePath: '/sdk/uniapp/calling/managing-calls/hang-up-call'
---

```uts
import { signalingHungUp } from '@/uni_modules/unix-openim-sdk'

await signalingHungUp({ invitation })
```

After a call has connected, a participant uses the <span className="enterprise-field-badge">Commercial</span> `signalingHungUp()` operation. Pass the complete `OpenIMSignalingInvitationInfo` used by the current call; its `roomID` must match the active media room.

Promise success only means the hangup signaling request completed. The application must also stop local capture, disconnect the media room, and release camera, microphone, and page resources.

Lock the ending transition so local UI actions, remote hangup, timeout, and network errors cannot execute cleanup twice. Cancellation, rejection, timeout, and hangup should converge on one idempotent cleanup flow keyed by `roomID`. Continue handling `onHangUp` as documented in [call events](/sdk/uniapp/calling/managing-calls/handle-call-events).
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
title: 'Reject a call'
description: 'OpenIM uni-app / uni-app x SDK guide for Reject a call.'
product: 'sdk'
context: 'chat/sdk/uniapp'
template: 'guide'
status: 'published'
lastUpdated: '2026-08-13'
version: 'v4'
platform: 'uniapp'
sourcePath: '/sdk/uniapp/calling/managing-calls/reject-call'
---

```uts
import { signalingReject } from '@/uni_modules/unix-openim-sdk'

await signalingReject({ invitation })
```

When the user declines an incoming call, pass the complete received `OpenIMSignalingInvitationInfo` to the <span className="enterprise-field-badge">Commercial</span> `signalingReject()` operation. Do not reconstruct the invitation or alter its `roomID`.

Promise success only means OpenIMServer completed the reject request. The local incoming-call UI can then close, while the inviter updates through `onInviteeRejected`. Remote and multi-device events may race with the local action and must be handled idempotently. See [call events](/sdk/uniapp/calling/managing-calls/handle-call-events) for the complete lifecycle.
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
---
title: 'Start a group call'
description: 'OpenIM uni-app / uni-app x SDK guide for Start a group call.'
product: 'sdk'
context: 'chat/sdk/uniapp'
template: 'guide'
status: 'published'
lastUpdated: '2026-08-13'
version: 'v4'
platform: 'uniapp'
sourcePath: '/sdk/uniapp/calling/managing-calls/start-group-call'
---

The <span className="enterprise-field-badge">Commercial</span> `signalingInviteInGroup()` operation starts a group call. It invites only the users listed in `inviteeUserIDList`; setting `groupID` does not automatically invite every group member.

## Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `invitation.inviterUserID` | `string` | Yes | Current user ID. |
| `invitation.inviteeUserIDList` | `string[]` | Yes | Selected members; exclude the inviter. |
| `invitation.groupID` | `string` | Yes | Target group ID. |
| `invitation.roomID` | `string` | Yes | Shared unique room identifier. |
| `invitation.timeout` | `number` | Yes | Invitation timeout in seconds. |
| `invitation.mediaType` | `string` | Yes | `audio` or `video` by application convention. |
| `invitation.sessionType` | `number` | Yes | Use the matching group session constant. |
| `invitation.platformID` | `number` | Yes | Current native platform constant. |
| `invitation.customData` | `string` | No | Application extension data. |
| `invitation.initiateTime` | `number` | No | Invitation start time. The signaling flow normally maintains it, so new calls can omit it. |
| `invitation.busyLineUserIDList` | `string[]` | No | Busy-user list returned by an existing flow. Omit it when starting a new invitation. |
| `offlinePushInfo` | `OpenIMSignalingOfflinePushInfo` | No | Offline push content. |
| `offlinePushInfo.title` | `string` | Conditional | Push title, required when `offlinePushInfo` is provided. |
| `offlinePushInfo.desc` | `string` | Conditional | Push body, required when `offlinePushInfo` is provided. |
| `offlinePushInfo.ex` | `string` | Conditional | Extension string, required when `offlinePushInfo` is provided. Pass an empty string if unused. |
| `offlinePushInfo.iOSPushSound` | `string` | Conditional | iOS push sound, required when `offlinePushInfo` is provided. |
| `offlinePushInfo.iOSBadgeCount` | `boolean` | Conditional | Whether the push updates the iOS badge, required when `offlinePushInfo` is provided. |

```uts
import {
OpenIMPlatformAndroid,
OpenIMSessionTypeWriteGroup,
signalingInviteInGroup,
} from '@/uni_modules/unix-openim-sdk'

const roomCredentials = await signalingInviteInGroup({
invitation: {
inviterUserID: currentUserID,
inviteeUserIDList: selectedGroupMemberIDs,
customData: JSON.stringify({ source: 'group-call' }),
groupID,
roomID: groupID,
timeout: 30,
mediaType: 'video',
sessionType: OpenIMSessionTypeWriteGroup,
platformID: OpenIMPlatformAndroid,
},
offlinePushInfo,
})
```

This example reuses the group ID as the room ID. If the application generates a different room ID, all participants must use that value. Use `OpenIMPlatformIOS` on iOS. Exclude the current user, blank IDs, and duplicates, and verify that selected users are still group members.

The Promise resolves to `OpenIMSignalingInviteResult | null`; see [Start a one-to-one call](/sdk/uniapp/calling/managing-calls/start-single-call) for all fields. A busy-user list only identifies members who were busy at invite time. It must not cancel invitations for other users, and success does not mean anyone has accepted. Merge later acceptance, rejection, and timeout through [call events](/sdk/uniapp/calling/managing-calls/handle-call-events).
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
---
title: 'Start a one-to-one call'
description: 'OpenIM uni-app / uni-app x SDK guide for Start a one-to-one call.'
product: 'sdk'
context: 'chat/sdk/uniapp'
template: 'guide'
status: 'published'
lastUpdated: '2026-08-13'
version: 'v4'
platform: 'uniapp'
sourcePath: '/sdk/uniapp/calling/managing-calls/start-single-call'
---

The <span className="enterprise-field-badge">Commercial</span> `signalingInvite()` operation starts a one-to-one audio or video call. `unix-openim-sdk` creates the signaling invitation; the application still joins its media engine with the returned room credentials.

## Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `invitation` | `OpenIMSignalingInvitationInfo` | Yes | Invitation for this call. |
| `invitation.inviterUserID` | `string` | Yes | Current logged-in user ID. |
| `invitation.inviteeUserIDList` | `string[]` | Yes | Invitees; use one peer for a one-to-one call. |
| `invitation.groupID` | `string` | Yes | Use an empty string for one-to-one calls. |
| `invitation.roomID` | `string` | Yes | Unique room identifier shared by all call state. |
| `invitation.timeout` | `number` | Yes | Invitation timeout in seconds. |
| `invitation.mediaType` | `string` | Yes | Application convention such as `audio` or `video`. |
| `invitation.sessionType` | `number` | Yes | Use `OpenIMSessionTypeSingle`. |
| `invitation.platformID` | `number` | Yes | Current native platform constant. |
| `invitation.customData` | `string` | No | Application extension data. |
| `offlinePushInfo` | `OpenIMSignalingOfflinePushInfo` | No | Offline push title, description, and iOS settings. |

```uts
import {
OpenIMPlatformAndroid,
OpenIMSessionTypeSingle,
signalingInvite,
} from '@/uni_modules/unix-openim-sdk'

const roomCredentials = await signalingInvite({
invitation: {
inviterUserID: currentUserID,
inviteeUserIDList: [peerUserID],
customData: JSON.stringify({ source: 'contact-card' }),
groupID: '',
roomID: createBusinessRoomID(),
timeout: 30,
mediaType: 'video',
sessionType: OpenIMSessionTypeSingle,
platformID: OpenIMPlatformAndroid,
},
offlinePushInfo: {
title: 'Video call',
desc: 'You have an incoming video call',
ex: '',
iOSPushSound: 'default',
iOSBadgeCount: true,
},
})
```

Use `OpenIMPlatformIOS` on iOS. Generate a stable room ID for this call and keep it consistent across participants.

## Result

The Promise resolves to `OpenIMSignalingInviteResult | null`:

| Field | Type | Description |
| --- | --- | --- |
| `roomID` | `string` or `null` | Media room identifier. |
| `token` | `string` or `null` | Short-lived room credential. |
| `liveURL` | `string` or `null` | Media service connection address. |
| `busyLineUserIDList` | `string[]` or `null` | Users who were busy when invited. |
| `invitation` | `OpenIMSignalingInvitationInfo` or `null` | Server invitation snapshot. |

Join the media engine only after obtaining a valid room ID and token. Promise success does not mean the peer accepted; merge later state through [call events](/sdk/uniapp/calling/managing-calls/handle-call-events). If the application cannot present outgoing call UI after the invite succeeds, actively cancel the invitation. Never log room credentials.
Loading