Restore pending call invitations
Query active, pending call invitations when your app launches or returns to the foreground.
Query whether the current account has any active, pending audio or video call invitations. This method provides strongly typed, complete invitation records upon cold start, when returning from the background, or following receipt of an incoming call notification.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
userID | string | No | The current logged-in user ID. |
The parameter object can be omitted. When providing userID, pass the currently authenticated user's ID. Do not query invitations on behalf of other users.
Code example
import {
signalingGetInvitationInfoStartApp,
} from '@/uni_modules/unix-openim-sdk'
const result = await signalingGetInvitationInfoStartApp({
userID: currentUserID,
})
if (result?.invitation?.roomID != null) {
restoreIncomingCall(result.invitation!)
}Return value
The Promise resolves with an OpenIMSignalingGetInvitationInfoStartAppResult | null object containing an invitation property of type OpenIMSignalingInvitationInfo | null. If no valid invitation is returned, clear any stale incoming call views indexed by roomID to prevent reuse of outdated room state.
State changes after the call
This is a read-only query that checks current invitation state without accepting, rejecting, or generating events. After restoring incoming call UI, continue listening for cancellations, timeouts, remote answers, and hang-up notifications as described in Handle call events.
Was this page helpful?