Browse SDKs · React Native
SDKsReact NativeEnterprise

Start a one-to-one call

Start a one-to-one audio or video call with OpenIM React Native SDK.

Copy

Call signalingInvite() to start a one-to-one audio or video call. The call returns room credentials that the app can use to connect a real-time audio and video media engine with roomID, token, and liveURL.

const roomCredentials = await OpenIMSDK.signalingInvite({
  invitation: {
    inviterUserID: currentUserID,
    inviteeUserIDList: [peerUserID],
    groupID: '',
    roomID,
    timeout: 30,
    mediaType: 'video',
    sessionType: SessionType.Single,
    platformID: currentPlatform,
  },
});

Parameters

ParameterTypeRequiredDescription
invitationRtcInviteYesThe call invitation.
invitation.inviterUserIDstringYesUser ID of the user starting the call.
invitation.inviteeUserIDListstring[]YesInvited user IDs. For a one-to-one call, provide the other user's ID.
invitation.groupIDstringYesPass an empty string for a one-to-one call.
invitation.roomIDstringYesRoom ID for this call. Subsequent call operations and state handling use this value to identify the call.
invitation.timeoutnumberYesInvitation timeout in seconds.
invitation.mediaTypestringYesMedia type, such as audio or video.
invitation.sessionTypeSessionTypeYesPass SessionType.Single for a one-to-one call.
invitation.platformIDPlatformYesInviter platform. Pass the Platform enum value for the current client.
invitation.customDatastringNoApplication-defined extension string sent with the invitation.
invitation.initiateTimenumberNoInvitation start time as a Unix timestamp in milliseconds. It is usually managed by the calling flow and does not need to be set manually.
invitation.busyLineUserIDListstring[]NoBusy-user list. It is usually omitted when starting a new invitation.
offlinePushInfoOfflinePushNoPush content for invited users when they are offline.
offlinePushInfo.titlestringConditionalPush title when offlinePushInfo is provided.
offlinePushInfo.descstringConditionalPush body when offlinePushInfo is provided.
offlinePushInfo.exstringConditionalExtension string when offlinePushInfo is provided. Pass an empty string when there is no content.
offlinePushInfo.iOSPushSoundstringConditionaliOS push sound when offlinePushInfo is provided.
offlinePushInfo.iOSBadgeCountbooleanConditionalWhether to update the iOS badge when offlinePushInfo is provided.

Return value

The call returns RtcInviteResults:

FieldTypeDescription
roomIDstringCall room ID.
tokenstringCredential for joining the call room.
liveURLstringRoom address returned by the calling service.
busyLineUserIDListstring[]IDs of invited users that are currently busy.

The invitee receives OnReceiveNewInvitation with OnReceiveNewInvitationPayload. For acceptance, rejection, cancellation, and hang-up events, see Handle call events.