SDKsReact NativeEnterprise
Start a one-to-one call
Start a one-to-one audio or video call with OpenIM React Native SDK.
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
| Parameter | Type | Required | Description |
|---|---|---|---|
invitation | RtcInvite | Yes | The call invitation. |
invitation.inviterUserID | string | Yes | User ID of the user starting the call. |
invitation.inviteeUserIDList | string[] | Yes | Invited user IDs. For a one-to-one call, provide the other user's ID. |
invitation.groupID | string | Yes | Pass an empty string for a one-to-one call. |
invitation.roomID | string | Yes | Room ID for this call. Subsequent call operations and state handling use this value to identify the call. |
invitation.timeout | number | Yes | Invitation timeout in seconds. |
invitation.mediaType | string | Yes | Media type, such as audio or video. |
invitation.sessionType | SessionType | Yes | Pass SessionType.Single for a one-to-one call. |
invitation.platformID | Platform | Yes | Inviter platform. Pass the Platform enum value for the current client. |
invitation.customData | string | No | Application-defined extension string sent with the invitation. |
invitation.initiateTime | number | No | Invitation 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.busyLineUserIDList | string[] | No | Busy-user list. It is usually omitted when starting a new invitation. |
offlinePushInfo | OfflinePush | No | Push content for invited users when they are offline. |
offlinePushInfo.title | string | Conditional | Push title when offlinePushInfo is provided. |
offlinePushInfo.desc | string | Conditional | Push body when offlinePushInfo is provided. |
offlinePushInfo.ex | string | Conditional | Extension string when offlinePushInfo is provided. Pass an empty string when there is no content. |
offlinePushInfo.iOSPushSound | string | Conditional | iOS push sound when offlinePushInfo is provided. |
offlinePushInfo.iOSBadgeCount | boolean | Conditional | Whether to update the iOS badge when offlinePushInfo is provided. |
Return value
The call returns RtcInviteResults:
| Field | Type | Description |
|---|---|---|
roomID | string | Call room ID. |
token | string | Credential for joining the call room. |
liveURL | string | Room address returned by the calling service. |
busyLineUserIDList | string[] | 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.
Was this page helpful?