SDKsReact NativeEnterprise
Start a one-to-one call
Initiate a direct audio or video call using the OpenIM React Native SDK.
Initiate a direct one-to-one audio or video call. When the method resolves, use the returned room credentials (roomID, token, and liveURL) to connect your real-time audio/video media engine.
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 | Call invitation payload. |
invitation.inviterUserID | string | Yes | User ID of the caller initiating the call. |
invitation.inviteeUserIDList | string[] | Yes | List containing the recipient user ID for direct calls. |
invitation.groupID | string | Yes | Pass an empty string "" for direct one-to-one calls. |
invitation.roomID | string | Yes | Unique identifier for this call room. Used in subsequent call operations and events. |
invitation.timeout | number | Yes | Invitation timeout duration in seconds. |
invitation.mediaType | string | Yes | Media stream type, such as 'audio' or 'video'. |
invitation.sessionType | SessionType | Yes | Pass SessionType.Single for direct calls. |
invitation.platformID | Platform | Yes | Platform enum value representing the caller's operating platform. |
invitation.customData | string | No | Optional business extension string attached to the invitation. |
invitation.initiateTime | number | No | Initiation timestamp in Unix milliseconds. Automatically generated if omitted. |
invitation.busyLineUserIDList | string[] | No | List of users currently on a busy line. Leave empty when initiating. |
offlinePushInfo | OfflinePush | No | Offline push configuration when the recipient is offline. |
offlinePushInfo.title | string | Conditional | Notification title when offlinePushInfo is provided. |
offlinePushInfo.desc | string | Conditional | Notification body text when offlinePushInfo is provided. |
offlinePushInfo.ex | string | Conditional | Custom extra payload string. Pass empty string "" if not needed. |
offlinePushInfo.iOSPushSound | string | Conditional | iOS push sound file identifier. |
offlinePushInfo.iOSBadgeCount | boolean | Conditional | Whether to increment the iOS application badge count. |
Return value
Resolves to an RtcInviteResults object:
| Field | Type | Description |
|---|---|---|
roomID | string | Unique identifier of the calling room. |
token | string | Authentication token used by the media engine to enter the room. |
liveURL | string | Endpoint URL of the media server room. |
busyLineUserIDList | string[] | List of invited users currently occupied on another call. |
The recipient receives an invitation notification via the OnReceiveNewInvitation event. Identify the active call session using roomID and combine roomID:userID to manage calling and connected states. For accept, reject, cancel, and hang-up flows, see Handle call events.
Was this page helpful?