Browse SDKs · uni-app / uni-app x
SDKsuni-appEnterprise

Accept a call

OpenIM uni-app / uni-app x SDK guide for Accept a call.

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

const roomCredentials = await signalingAccept({ invitation })

signalingAccept() is Commercial. 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:

FieldTypeDescription
roomIDstring or nullMedia room identifier for this call.
tokenstring or nullShort-lived credential used to join the room.
liveURLstring or nullMedia service connection address.
invitationOpenIMSignalingInvitationInfo or nullInvitation 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.