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.
V2TIMManager(Signaling)

Instance Methods

(void) - addSignalingListener:
 
(void) - removeSignalingListener:
 
(NSString *) - invite:data:onlineUserOnly:offlinePushInfo:timeout:succ:fail:
 
(NSString *) - inviteInGroup:inviteeList:data:onlineUserOnly:timeout:succ:fail:
 
(void) - cancel:data:succ:fail:
 
(void) - accept:data:succ:fail:
 
(void) - reject:data:succ:fail:
 
(V2TIMSignalingInfo *) - getSignallingInfo:
 
(void) - addInvitedSignaling:succ:fail:
 
(void) - modifyInvitation:data:succ:fail:
 

Member Typedef Documentation

◆ V2TIMSignalingInfoSucc

- (typedef void(^ V2TIMSignalingInfoSucc) (V2TIMSignalingInfo *signalInfo))
protected

Callback definition on get signaling information successfully

Method Documentation

◆ addSignalingListener:()

- (void) addSignalingListener: (addSignalingListener(listener:))  NS_SWIFT_NAME

Add the signaling listener

◆ removeSignalingListener:()

- (void) removeSignalingListener: (removeSignalingListener(listener:))  NS_SWIFT_NAME

Remove the signaling listener

◆ invite:data:onlineUserOnly:offlinePushInfo:timeout:succ:fail:()

- (NSString*) invite: (NSString *)  invitee
data: (NSString *)  data
onlineUserOnly: (BOOL)  onlineUserOnly
offlinePushInfo: (V2TIMOfflinePushInfo *)  offlinePushInfo
timeout: (int)  timeout
succ: (V2TIMSucc)  succ
fail: (V2TIMFail)  fail 

Invite someone

Parameters
inviteeInvitee's user ID
dataCustom data
timeoutTimeout duration, in seconds. If it is set to 0, the SDK does not perform timeout detection nor trigger the onInvitationTimeout callback.
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.
Returns
inviteID Invitation ID. If the invitation fails, null is returned.

◆ inviteInGroup:inviteeList:data:onlineUserOnly:timeout:succ:fail:()

- (NSString*) inviteInGroup: (NSString *)  groupID
inviteeList: (NSArray *)  inviteeList
data: (NSString *)  data
onlineUserOnly: (BOOL)  onlineUserOnly
timeout: (int)  timeout
succ: (V2TIMSucc)  succ
fail: (V2TIMFail)  fail 

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.
timeoutTimeout duration, in seconds. If it is set to 0, the SDK does not perform timeout detection nor trigger the onInvitationTimeout callback.
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).
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:data:succ:fail:()

- (void) cancel: (NSString *)  inviteID
data: (NSString *)  data
succ: (V2TIMSucc)  succ
fail: (V2TIMFail)  fail 

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:data:succ:fail:()

- (void) accept: (NSString *)  inviteID
data: (NSString *)  data
succ: (V2TIMSucc)  succ
fail: (V2TIMFail)  fail 

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:data:succ:fail:()

- (void) reject: (NSString *)  inviteID
data: (NSString *)  data
succ: (V2TIMSucc)  succ
fail: (V2TIMFail)  fail 

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.

◆ getSignallingInfo:()

- (V2TIMSignalingInfo *) getSignallingInfo: (V2TIMMessage *)  msg

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 nil, msg is not a signaling message.

◆ addInvitedSignaling:succ:fail:()

- (void) addInvitedSignaling: (V2TIMSignalingInfo *)  signallingInfo
succ: (V2TIMSucc)  succ
fail: (V2TIMFail)  fail 

Add invitation signaling

It is mainly used for inviter to send group invitation when the invitees are offline, and sync the signaling info to SDK after the invitees are online, so as to use the signaling function normally.

When the invitee clicks the offline push message notification and starts the App:

  1. If the inviter sends 1v1 signaling while the invitee is offline, SDK can automatically sync the invitation signaling. If the invitation does not timed out, onReceiveNewInvitation will be called.
  2. If the inviter sends group signaling while the invitee is offline, different SDK behaviors are as follows:
  • versions lower than 6.7: SDK cannot automatically sync the invitation signaling. If the invitee needs to deal with the invitation, the inviter can send an extra C2C offline push message carrying V2TIMSignalingInfo object to each invitee while sending the invitation. When the invitee receives the offline push message, he could invoke addInvitedSignaling to sync the V2TIMSignalingInfo to SDK.
  • versions equal or higher than 6.7: SDK can automatically sync messages for the last 30 seconds. If it contains invitation signaling that does not timed out, onReceiveNewInvitation will be called. You no longer need to call this API to sync the invitation signaling info.
Attention
If the added signaling information already exists, the callback throws the ERR_SDK_SIGNALING_ALREADY_EXISTS error code.

◆ modifyInvitation:data:succ:fail:()

- (void) modifyInvitation: (NSString *)  inviteID
data: (NSString *)  data
succ: (V2TIMSucc)  succ
fail: (V2TIMFail)  fail 

Modify the invitaion (supported only in 6.7 and later versions)

Attention
Only supports modifying the custom field data of the invitation. Invitation that can only be received by online users cannot be modified.