Browse SDKs · HarmonyOS
Platform
SDKsHarmonyOSEnterprise

Restore pending call invitation

Query unhandled call invitations still pending when the app launches or returns to the foreground.

Copy

When the app cold starts, resumes from the background, or reconnects after missed incoming call events, check for unhandled call invitations targeted at the current account:

Code example

import sdk, {
  SignalingGetInvitationInfoStartAppReq,
  SignalingGetInvitationInfoStartAppResp,
} from '@openimsdk/imsdk';

const request: SignalingGetInvitationInfoStartAppReq = { userID: currentUserID };
const response: SignalingGetInvitationInfoStartAppResp =
  await sdk.signalingGetInvitationInfoStartApp(request);
if (response.invitation.roomID.length > 0) {
  restoreIncomingCall(response.invitation, response.offlinePush);
}

Parameters

ParameterTypeRequiredDescription
userIDstringYesThe currently logged-in user identifier.

Return value

Returns a Promise that resolves to a SignalingGetInvitationInfoStartAppResp object:

PropertyTypeDescription
invitationSignalingInvitationInfoThe unhandled call invitation object.
offlinePushOfflinePushInfoThe push notification payload accompanying the invitation.

State changes after the call

Specify only the currently signed-in user's ID; do not query invitations for other accounts. If response.invitation.roomID is empty, dismiss any lingering incoming call dialogs and clear cached credentials. This query only checks invitation state; it does not automatically accept, reject, or re-emit signaling events.