SDKsHarmonyOSEnterprise
Restore pending call invitation
Query unhandled call invitations still pending when the app launches or returns to the foreground.
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
| Parameter | Type | Required | Description |
|---|---|---|---|
userID | string | Yes | The currently logged-in user identifier. |
Return value
Returns a Promise that resolves to a SignalingGetInvitationInfoStartAppResp object:
| Property | Type | Description |
|---|---|---|
invitation | SignalingInvitationInfo | The unhandled call invitation object. |
offlinePush | OfflinePushInfo | The 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.
Was this page helpful?