IMSDK
IM features a comprehensive suite of solutions including global access, one-to-one chat, group chat, message push, profile and relationship chain hosting, and account authentication. It also provides complete app access and backend management APIs.
V2TIMSignalingManagerabstract

Public Member Functions

abstract void addSignalingListener (V2TIMSignalingListener listener)
 
abstract void removeSignalingListener (V2TIMSignalingListener listener)
 
abstract String invite (String invitee, String data, boolean onlineUserOnly, V2TIMOfflinePushInfo offlinePushInfo, int timeout, V2TIMCallback callback)
 
abstract String inviteInGroup (String groupID, List< String > inviteeList, String data, boolean onlineUserOnly, int timeout, V2TIMCallback callback)
 
abstract void cancel (String inviteID, String data, V2TIMCallback callback)
 
abstract void accept (String inviteID, String data, V2TIMCallback callback)
 
abstract void reject (String inviteID, String data, V2TIMCallback callback)
 
abstract V2TIMSignalingInfo getSignalingInfo (V2TIMMessage msg)
 
abstract void addInvitedSignaling (final V2TIMSignalingInfo info, final V2TIMCallback callback)
 

Member Function Documentation

◆ addSignalingListener()

abstract void addSignalingListener ( V2TIMSignalingListener  listener)
abstract

Add the signaling listener

◆ removeSignalingListener()

abstract void removeSignalingListener ( V2TIMSignalingListener  listener)
abstract

Remove the signaling listener

◆ invite()

abstract String invite ( String  invitee,
String  data,
boolean  onlineUserOnly,
V2TIMOfflinePushInfo  offlinePushInfo,
int  timeout,
V2TIMCallback  callback 
)
abstract

Invite someone

Parameters
inviteeInvitee's user ID
dataCustom data
onlineUserOnlyWhether the message can be received only by online users. If this field is set to true, the message can be received only by online users, and the invite operation does not produce historical messages (nor do subsequent cancel, accept, reject, and timeout operations of this invite operation). The invite operation does not produce historical messages (nor do subsequent cancel, accept, reject, and timeout operations of this invite operation).
offlinePushInfoOffline push information, where the desc field is required. The information specified by desc will be displayed by default during push.
timeoutTimeout duration, in seconds. If it is set to 0, the SDK does not perform timeout detection nor trigger the onInvitationTimeout callback.
Returns
inviteID Invitation ID. If the invitation fails, null is returned.

◆ inviteInGroup()

abstract String inviteInGroup ( String  groupID,
List< String >  inviteeList,
String  data,
boolean  onlineUserOnly,
int  timeout,
V2TIMCallback  callback 
)
abstract

Invite certain users in the group

Parameters
groupIDID of the inviter's group
inviteeListList of invitees. Invitees specified by inviteeList must be in the group specified by groupID. Otherwise, the invitation fails.
onlineUserOnlyWhether the message can be received only by online users. If this field is set to true, the message can be received only by online users, and the invite operation does not produce historical messages (nor do subsequent cancel, accept, reject, and timeout operations of this invite operation). The invite operation does not produce historical messages (nor do subsequent cancel, accept, reject, and timeout operations of this invite operation).
timeoutTimeout duration, in seconds. If it is set to 0, the SDK does not perform timeout detection nor trigger the onInvitationTimeout callback.
Returns
inviteID Invitation ID. If the invitation fails, null is returned.
Attention
Currently, Group invitation does not support offline push. If you need offline push, you can send custom offline push messages to invitees separately.

◆ cancel()

abstract void cancel ( String  inviteID,
String  data,
V2TIMCallback  callback 
)
abstract

The inviter canceled the invitation

Parameters
inviteIDInvitation ID
Attention
If all invitees have processed the current invitation (including timeout), the current invitation cannot be cancelled.

◆ accept()

abstract void accept ( String  inviteID,
String  data,
V2TIMCallback  callback 
)
abstract

The invitee accepts the invitation

Attention
Users cannot accept only invitations that are not targeted at themselves. When receiving the onReceiveNewInvitation callback, check whether the current user is specified in inviteeList. If no, the current user cannot accept the invitation.

◆ reject()

abstract void reject ( String  inviteID,
String  data,
V2TIMCallback  callback 
)
abstract

The invitee rejects the invitation

Attention
Users cannot reject only invitations that are not targeted at themselves. When receiving the onReceiveNewInvitation callback, check whether the current user is specified in inviteeList. If no, the current user cannot reject the invitation.

◆ getSignalingInfo()

abstract V2TIMSignalingInfo getSignalingInfo ( V2TIMMessage  msg)
abstract

Get the signaling information

If onlineUserOnly is set to false in the invite operation, a custom message is generated for each signaling operation (including the invite, cancel, accept, reject, and timeout operations). The message will be delivered to users via V2TIMAdvancedMsgListener -> onRecvNewMessage and can be pulled by users via historical message pulling. If you want to customize the display text based on the signaling information, call the following API to get the signaling information.

Parameters
msgMessage object
Returns
V2TIMSignalingInfo Signaling information. If the value is null, msg is not a signaling message.

◆ addInvitedSignaling()

abstract void addInvitedSignaling ( final V2TIMSignalingInfo  info,
final V2TIMCallback  callback 
)
abstract

Add invitation signaling (can be used for invitation signaling triggered by group offline push messages)

In offline push scenarios:

  • One-to-one invitation: if the invitee's app is killed and is started again when receiving an offline push, the user will receive the onReceiveNewInvitation callback if the invitation does not time out and receive the onInvitationTimeout callback if the invitation times out.
  • Group invitation: if the invitee's app is killed and is started again when receiving an offline push, the SDK cannot automatically sync the invitation signaling information. If you want to process the invitation in this scenario, contain the signaling information when sending the push message, parse the signaling information when receiving the push, and call addInvitedSignaling to proactively add the signaling information.

TUIKit implements offline push for audio/video calls based on this API. For details of the implementation method, see Enabling Audio/Video Calls.

Attention
If the added signaling information already exists, the callback throws the ERR_SDK_SIGNALING_ALREADY_EXISTS error code.