sdk

package
v3.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 14, 2025 License: MIT Imports: 19 Imported by: 5

Documentation

Overview

* @Descripttion: * @version: * @Author: ran.ding * @Date: 2019-09-02 18:29:55 * @LastEditors: ran.ding * @LastEditTime: 2019-09-10 11:37:14

* @Descripttion: * @version: * @Author: ran.ding * @Date: 2019-09-02 18:29:55 * @LastEditors: ran.ding * @LastEditTime: 2019-09-10 11:22:38

Index

Constants

View Source
const (
	PRIVATE            ConversationType = iota + 1 // PRIVATE one-to-one chat
	DISCUSSION                                     // DISCUSSION discussion group chat
	GROUP                                          // GROUP group chat
	CHATROOM                                       // CHATROOM chatroom chat
	CUSTOM                                         // CUSTOM customer service chat
	SYSTEM                                         // SYSTEM system notification
	APP_PUBLIC_SERVICE                             // APP_PUBLIC_SERVICE app public service
	PUBLIC_SERVICE                                 // PUBLIC_SERVICE public service
	ULTRA_GROUP                                    // ULTRA_GROUP ultra group service

	ConversationTypePrivate ConversationType = 1  // ConversationTypePrivate one-to-one chat
	ConversationTypeGroup   ConversationType = 3  // ConversationTypeGroup group chat
	ConversationTypeSystem  ConversationType = 6  // ConversationTypeSystem system
	ConversationTypeUG      ConversationType = 10 // ConversationTypeUG ultra group

	ConversationUnPushLevelAllMessage        = -1 // ConversationUnPushLevelAllMessage all message notifications
	ConversationUnPushLevelNotSet            = 0  // ConversationUnPushLevelNotSet not set
	ConversationUnPushLevelAtMessage         = 1  // ConversationUnPushLevelAtMessage only @message notifications
	ConversationUnPushLevelAtUser            = 2  // ConversationUnPushLevelAtUser @specific user notifications
	ConversationUnPushLevelAtAllGroupMembers = 4  // ConversationUnPushLevelAtAllGroupMembers @all group members notifications
	ConversationUnPushLevelNotRecv           = 5  // ConversationUnPushLevelNotRecv do not receive notifications
)
View Source
const (
	MessagePrivateType = 1 // MessagePrivateType one-to-one chat
	MessageGroupType   = 3 // MessageGroupType group chat
)
View Source
const (
	// ReqType Body type
	ReqType = "json"
	// USERAGENT SDK name
	USERAGENT = "rc-go-sdk/3.2.23"
	// DEFAULTTIMEOUT Default timeout, 10 seconds
	DEFAULTTIMEOUT = 10
	// DEFAULT_KEEPALIVE Default HTTP keepalive time, 30 seconds
	DEFAULT_KEEPALIVE = 30
	// DEFAULT_MAXIDLECONNSPERHOST Default maximum idle connections per host, 100
	DEFAULT_MAXIDLECONNSPERHOST = 100
	// DEFAULT_CHANGE_URI_DURATION Interval for automatic API URL switching, in seconds
	DEFAULT_CHANGE_URI_DURATION = 30
)
View Source
const (
	UGUnPushLevelAllMessage        = -1 // UGUnPushLevelAllMessage Notify all messages
	UGUnPushLevelNotSet            = 0  // UGUnPushLevelNotSet Not set
	UGUnPushLevelAtMessage         = 1  // UGUnPushLevelAtMessage Notify only @ messages
	UGUnPushLevelAtUser            = 2  // UGUnPushLevelAtUser Notify @ specific users
	UGUnPushLevelAtAllGroupMembers = 4  // UGUnPushLevelAtAllGroupMembers Notify @ all group members
	UGUnPushLevelNotRecv           = 5  // UGUnPushLevelNotRecv Do not receive notifications
)

Variables

View Source
var (
	REGION_BJ   = Region{"https://api.rong-api.com", "https://api-b.rong-api.com"}
	REGION_SG   = Region{"https://api.sg-light-api.com", "https://api-b.sg-light-api.com"}
	REGION_SG_B = Region{"https://api.sg-b-light-api.com", "https://api-b.sg-b-light-api.com"}
	REGION_NA   = Region{"https://api.us-light-api.com", "https://api-b.us-light-api.com"}
	REGION_SAU  = Region{"https://api.sau-light-api.com", "https://api-b.sau-light-api.com"}
)

Functions

func RCErrorNew

func RCErrorNew(code int, text string) error

RCErrorNew creates a new error message.

func RCErrorNewV2 added in v3.2.8

func RCErrorNewV2(code int, text string) error

RCErrorNewV2 creates a new error message for API v2.

func WithKeepAlive added in v3.2.0

func WithKeepAlive(t time.Duration) rongCloudOption

WithKeepAlive sets the connection keep-alive duration, with the minimum unit in seconds

func WithMaxIdleConnsPerHost added in v3.2.0

func WithMaxIdleConnsPerHost(n int) rongCloudOption

WithMaxIdleConnsPerHost sets the maximum number of connections per host

func WithRongCloudURI

func WithRongCloudURI(rongCloudURI string) rongCloudOption

WithRongCloudURI sets the RongCloud URI

func WithTimeout

func WithTimeout(t time.Duration) rongCloudOption

WithTimeout sets the timeout duration, with the minimum unit in seconds

func WithTransport added in v3.2.8

func WithTransport(transport http.RoundTripper) rongCloudOption

Types

type AndroidPush

type AndroidPush struct {
	Alert          string `json:"alert,omitempty"`          // Push message content for iOS or Android platforms. If specified, the default push message content is overridden and cannot be empty. (Optional)
	Extras         Extras `json:"extras,omitempty"`         // Extras should implement the Extras Interface. Additional information for iOS or Android platforms. Developers can parse this in the App as needed. PushNotification does not have this field. (Optional)
	ChannelId      string `json:"channelId,omitempty"`      // ChannelId for vendor-specific push channels. Currently supported vendors include: "MI" for Xiaomi, "HW" for Huawei, "OPPO". (Optional)
	Importance     string `json:"importance,omitempty"`     // Importance for Huawei notification priority, values: NORMAL, LOW, default is NORMAL for important messages. (Optional)
	Image          string `json:"image,omitempty"`          // Image URL for custom notification bar icon on the right for Huawei push. If not set, the icon is not displayed. URL must use HTTPS protocol, e.g., https://example.com/image.png. Icon file must be less than 512KB, recommended size: 40dp x 40dp, corner radius: 8dp. Icons larger than the recommended size may be compressed or not fully displayed. (Optional)
	LargeIconUri   string `json:"large_icon_uri,omitempty"` // LargeIconUri for custom notification bar icon on the right for Xiaomi push. If not set, the icon is not displayed. Domestic version only supports MIUI12 and above; international version supports. Image requirements: 120 * 120px, png or jpg format. (Optional)
	Classification string `json:"classification,omitempty"` // Classification for vivo push channel type. 0 for operational messages, 1 for system messages, default is the push channel type set in the developer backend for vivo push. (Optional)
}

AndroidPush Settings for Android platform push and additional information.

type Audience

type Audience struct {
	Tag         []string `json:"tag,omitempty"`    // User tags. Up to 20 tags can be sent at a time, with an AND relationship between tags. Invalid if is_to_all is true. (Optional)
	TagOr       []string `json:"tag_or,omitempty"` // User tags. Up to 20 tags can be sent at a time, with an OR relationship between tags. Invalid if is_to_all is true. tag_or can coexist with tag. (Optional)
	UserID      []string `json:"userid,omitempty"` // User IDs. Up to 1000 users can be sent at a time. If both tag and userid conditions exist, userid takes precedence. If userid is specified, the platform parameter is invalid. Invalid if is_to_all is true. (Optional)
	IsToAll     bool     `json:"is_to_all"`        // Whether to push to all users. false means push based on tag, tag_or, or userid conditions. true means push to all users, and tag, tag_or, and userid conditions are invalid. (Required)
	PackageName string   `json:"packageName"`      // Application package name. Invalid if is_to_all is true. If coexisting with tag or tag_or, it has an AND relationship, pushing to users who meet all conditions. If coexisting with userid, userid takes precedence. (Optional)
}

Audience Push conditions.

type BlacklistResult

type BlacklistResult struct {
	Users []string `json:"users"`
}

BlacklistResult Response information

type BlockListResult

type BlockListResult struct {
	Users []User `json:"users"`
}

BlockListResult Response information

type Broadcast

type Broadcast struct {
	PlatForm     []PlatForm   `json:"platform"`               // Target operating system, at least one of iOS or Android must be specified. If you need to push messages to both systems, both must be filled in. (Required)
	FromUserID   string       `json:"fromuserid"`             // Sender's user ID. (Required)
	Message      Message      `json:"message"`                // Broadcast message. (Required)
	Audience     Audience     `json:"audience"`               // Push conditions, including: tag, userid, packageName, is_to_all. (Required)
	Notification Notification `json:"notification,omitempty"` // Push content by operating system type. If both iOS and Android are set in platform, but only iOS content is set in notification, Android will use the initial alert content. (Optional)
}

Broadcast Broadcast message

type BroadcastRecallContent

type BroadcastRecallContent struct {
	MessageId        string `json:"messageUId"`
	ConversationType int    `json:"conversationType"`
	IsAdmin          int    `json:"isAdmin"`
	IsDelete         int    `json:"isDelete"`
}

BroadcastRecallContent Content of message broadcast recall

func (*BroadcastRecallContent) ToString

func (content *BroadcastRecallContent) ToString() (string, error)

*

  • @name: ToString
  • @test:
  • @msg: Converts the content structure parameter required for the broadcast message recall API to JSON
  • @param {type}
  • @return: string error

type CMDMsg

type CMDMsg struct {
	Name string      `json:"name"`
	Data string      `json:"data"`
	User MsgUserInfo `json:"user"`
}

CMDMsg message

func (*CMDMsg) ToString

func (msg *CMDMsg) ToString() (string, error)

ToString CMDMsg

type CMDNtf

type CMDNtf struct {
	Name string      `json:"operation"`
	Data string      `json:"data"`
	User MsgUserInfo `json:"user"`
}

CMDNtf message

func (*CMDNtf) ToString

func (msg *CMDNtf) ToString() (string, error)

ToString CMDNtf

type ChatRoom

type ChatRoom struct {
	ChatRoomID string `json:"chrmId"`
	Name       string `json:"name"`
	Time       string `json:"time"`
}

ChatRoom chatroom information

type ChatRoomAttr

type ChatRoomAttr struct {
	Key         string `json:"key"`
	Value       string `json:"value"`
	UserID      string `json:"userID"`
	AutoDelete  string `json:"autoDelete"`
	LastSetTime string `json:"lastSetTime"`
}

ChatRoomAttr Chatroom custom attributes structure

type ChatRoomAttrResult

type ChatRoomAttrResult struct {
	Keys []ChatRoomAttr `json:"keys"`
}

ChatRoomAttrResult Chatroom custom attributes return result

type ChatRoomGetResult added in v3.2.20

type ChatRoomGetResult struct {
	Code        int    `json:"code"`
	ChatroomId  string `json:"chatroomId"`
	CreateTime  int64  `json:"createTime"`
	MemberCount int    `json:"memberCount"`
	DestroyType int    `json:"destroyType"`
	DestroyTime int    `json:"destroyTime"`
	IsBan       bool   `json:"ban"`
}

Query chatroom information return result

type ChatRoomInfo

type ChatRoomInfo struct {
	ID   string `json:"id"`
	Name string `json:"name"`
}

ChatRoomInfo chatroom information

type ChatRoomKVNotiMessage

type ChatRoomKVNotiMessage struct {
	Type  int    `json:"type"`
	Key   string `json:"string"`
	Value string `json:"value"`
	Extra string `json:"extra"`
}

ChatRoomKVNotiMessage Chatroom custom attributes notification message

func (*ChatRoomKVNotiMessage) ToString

func (msg *ChatRoomKVNotiMessage) ToString() (string, error)

ToString ChatRoomKVNotiMessage

type ChatRoomQueryResult

type ChatRoomQueryResult struct {
	ChatRooms []ChatRoom `json:"chatRooms"`
}

ChatRoomQueryResult chatroom query interface return data

type ChatRoomResult

type ChatRoomResult struct {
	Total            int            `json:"total"`
	Users            []ChatRoomUser `json:"users"`
	Result           []ChatRoomUser `json:"result"`
	ObjectNames      []string       `json:"objectNames"`
	ChatRoomIDs      []string       `json:"chatroomids"`
	WhitelistMsgType []string       `json:"whitlistMsgType"`
}

ChatRoomResult ChatRoom return result

type ChatRoomUser

type ChatRoomUser struct {
	ID       string `json:"id"`
	UserID   string `json:"userId"`
	Time     string `json:"time"`
	IsInChrm int    `json:"isInChrm"`
}

ChatRoomUser Chatroom user information

type ChatUserExistObj added in v3.2.12

type ChatUserExistObj struct {
	// 200: Success.
	Code int `json:"code"`

	// Indicates whether the user is in the chatroom, true means in the chatroom, false means not in the chatroom.
	IsInChrm bool `json:"isInChrm"`
}

ChatUserExistObj : Return value of ChatUserExistResObj

type ChatroomOption added in v3.2.19

type ChatroomOption func(*chatroomOptions)

ChatroomOption Interface function

func WithChatroomDestroyTime added in v3.2.20

func WithChatroomDestroyTime(destroyTime int) ChatroomOption

Sets the chatroom destruction time, effective when destroyType=1, unit is minutes, minimum 60 minutes, maximum 10080 minutes (7 days). If not set, defaults to 60 minutes.

func WithChatroomDestroyType added in v3.2.20

func WithChatroomDestroyType(destroyType int) ChatroomOption

Specifies the chatroom destruction type: 0: Default value, means destruction when inactive, 1: Fixed time destruction

func WithChatroomEntryInfo added in v3.2.20

func WithChatroomEntryInfo(entryInfo map[string]interface{}) ChatroomOption

The KV pairs of chatroom custom attributes, in JSON structure

func WithChatroomEntryOwnerId added in v3.2.20

func WithChatroomEntryOwnerId(entryOwnerId string) ChatroomOption

The user ID to whom the chatroom custom attributes belong

func WithChatroomExtra added in v3.2.19

func WithChatroomExtra(extra string) ChatroomOption

The extra information in JSON format carried by the notification, valid only when needNotify is true.

func WithChatroomIsBan added in v3.2.20

func WithChatroomIsBan(isBan bool) ChatroomOption

Whether to mute all members of the chatroom, default is false

func WithChatroomNeedNotify added in v3.2.19

func WithChatroomNeedNotify(isNeedNotify bool) ChatroomOption

Whether to notify members. Default is false (no notification)

func WithChatroomWhiteUserIds added in v3.2.20

func WithChatroomWhiteUserIds(whiteUserIds []string) ChatroomOption

The allowlist of user IDs for muting, supports batch setting, maximum of 20 users

type CodeResult

type CodeResult struct {
	Code         int    `json:"code"`         // The return code, 200 indicates success.
	ErrorMessage string `json:"errorMessage"` // The error message.
}

CodeResult represents the status code and error code returned by RongCloud.

func (CodeResult) Error

func (e CodeResult) Error() string

Error retrieves the error message.

func (CodeResult) ErrorCode

func (e CodeResult) ErrorCode() int

ErrorCode retrieves the error code.

type CodeResultV2 added in v3.2.8

type CodeResultV2 struct {
	Code    int    `json:"code"` // The return code, 10000 indicates success.
	Message string `json:"msg"`  // The error message.
}

func (CodeResultV2) Error added in v3.2.8

func (e CodeResultV2) Error() string

Error retrieves the error message

func (CodeResultV2) ErrorCode added in v3.2.8

func (e CodeResultV2) ErrorCode() int

ErrorCode retrieves the error code

type ContactNtf

type ContactNtf struct {
	Operation    string      `json:"operation"`
	SourceUserID string      `json:"sourceUserId"`
	TargetUserID string      `json:"targetUserId"`
	Message      string      `json:"message"`
	Extra        string      `json:"extra"`
	User         MsgUserInfo `json:"user"`
}

ContactNtf message

func (*ContactNtf) ToString

func (msg *ContactNtf) ToString() (string, error)

ToString ContactNtf

type ConversationType

type ConversationType int

ConversationType Conversation type

type DizNtf

type DizNtf struct {
	Type      int         `json:"type"`
	Extension string      `json:"extension"`
	Operation string      `json:"operation"`
	User      MsgUserInfo `json:"user"`
}

DizNtf message

func (*DizNtf) ToString

func (msg *DizNtf) ToString() (string, error)

ToString DizNtf

type Extras

type Extras interface {
	ToJSON() ([]byte, error)
}

Extras Implement the Extras interface in IOSBroadcast and AndroidBroadcast

type FileMsg

type FileMsg struct {
	Name    string      `json:"name"`
	Size    string      `json:"size"`
	Type    string      `json:"type"`
	FileURL string      `json:"fileUrl"`
	User    MsgUserInfo `json:"user"`
}

FileMsg Message

func (*FileMsg) ToString

func (msg *FileMsg) ToString() (string, error)

ToString FileMsg

type Group

type Group struct {
	ID    string      `json:"id"`
	Users []GroupUser `json:"users"`
	Name  string      `json:"name"`
	Stat  string      `json:"stat"`
}

Group represents group information

type GroupForQuery added in v3.3.0

type GroupForQuery struct {
	ID   string `json:"groupId"`
	Stat int    `json:"stat"`
}

type GroupInfo

type GroupInfo struct {
	GroupInfo []GroupForQuery `json:"groupinfo"`
}

GroupInfo represents group information

type GroupRemarksGetObj added in v3.2.12

type GroupRemarksGetObj struct {
	// Code indicates the response code, 200 means success.
	Code int `json:"code"`

	// Remark specifies the alias name for the group member.
	Remark string `json:"remark"`
}

type GroupUser

type GroupUser struct {
	ID     string `json:"id"`
	UserID string `json:"userId"`
	Time   string `json:"time"`
}

GroupUser represents group user information

type GroupUserQueryGroup added in v3.2.12

type GroupUserQueryGroup struct {
	// Group name.
	Name string `json:"name"`

	// Group ID.
	Id string `json:"id"`
}

type GroupUserQueryObj added in v3.2.12

type GroupUserQueryObj struct {
	// Return code, 200 indicates success.
	Code int `json:"code"`

	// Array of group information the user has joined.
	Groups []GroupUserQueryGroup `json:"groups"`
}

GroupUserQueryObj : Return value of GroupUserQueryResObj

type GrpNtf

type GrpNtf struct {
	OperatorUserID string      `json:"operatorUserId"`
	Operation      string      `json:"operation"`
	Data           string      `json:"data"`
	Message        string      `json:"message"`
	Extra          string      `json:"extra"`
	User           MsgUserInfo `json:"user"`
}

GrpNtf message

func (*GrpNtf) ToString

func (msg *GrpNtf) ToString() (string, error)

ToString GrpNtf

type HQVCMsg added in v3.2.2

type HQVCMsg struct {
	LocalPath string      `json:"localPath"`
	RemoteUrl string      `json:"remoteUrl"`
	Duration  interface{} `json:"duration"`
	User      MsgUserInfo `json:"user"`
	Extra     string      `json:"extra"`
}

HQVCMsg High-Quality Voice Message RC:HQVCMsg

func (*HQVCMsg) ToString added in v3.2.2

func (msg *HQVCMsg) ToString() (string, error)

ToString HQVCMsg

type History

type History struct {
	URL string `json:"url"`
}

History History

type IMGTextMsg

type IMGTextMsg struct {
	Title    string      `json:"title"`
	Content  string      `json:"content"`
	User     MsgUserInfo `json:"user"`
	Extra    string      `json:"extra"`
	ImageUri string      `json:"imageUri"`
	URL      string      `json:"url"`
}

IMGTextMsg Message

func (*IMGTextMsg) ToString

func (msg *IMGTextMsg) ToString() (string, error)

ToString IMGTextMsg

type IOSPush

type IOSPush struct {
	Title            string `json:"title,omitempty"`            // The push title displayed in the notification bar, specific to the iOS platform, supported on iOS 8.2 and above. Parameters are set under the ios node. Refer to the "Set iOS Push Title Request Example" for details. (Optional)
	ContentAvailable int    `json:"contentAvailable,omitempty"` // For the iOS platform, silent push is a push method introduced after iOS7. It allows the app to run a piece of code in the background upon receiving the notification and execute it immediately. 1 indicates enabled, 0 indicates disabled, default is 0. (Optional)
	Alert            string `json:"alert,omitempty"`            // Push message content for iOS or Android platforms. If specified, the default push message content is overridden and cannot be empty. (Optional)
	Extras           Extras `json:"extras,omitempty"`           // Extras should implement the Extras Interface. Additional information for iOS or Android platforms. Developers can parse this in the App as needed. (Optional)
	Badge            int    `json:"badge,omitempty"`            // App badge number, specific to the iOS platform. If not specified, the badge number remains unchanged. If 0 or negative, the badge number is cleared. Otherwise, the specified number sets the badge number, with a maximum of 9999. Parameters are set under the ios node. Refer to the "Set iOS Badge Number HTTP Request Example" for details. (Optional)
	Category         string `json:"category,omitempty"`         // iOS rich push type defined by the developer, parsed in the App, used with richMediaUri. (Optional)
	RichMediaURI     string `json:"richMediaUri,omitempty"`     // URL for iOS rich push content, used with category. (Optional)
	ThreadId         string `json:"threadId,omitempty"`         // ThreadId for iOS platform notification grouping. Notifications with the same thread-id are grouped together, and groups with more than 5 notifications are collapsed. (Optional)
	ApnsCollapseId   string `json:"apns-collapse-id,omitempty"` // ApnsCollapseId for the iOS platform, supported from iOS10. Messages with the same ID are merged into one. (Optional)
}

IOSPush Settings for iOS platform push and additional information.

type ImgMsg

type ImgMsg struct {
	Content  string      `json:"content"`
	User     MsgUserInfo `json:"user"`
	ImageURI string      `json:"imageUri"`
	Extra    string      `json:"extra"`
}

ImgMsg message

func (*ImgMsg) ToString

func (msg *ImgMsg) ToString() (string, error)

ToString ImgMsg

type InfoNtf

type InfoNtf struct {
	Message string      `json:"message"`
	User    MsgUserInfo `json:"user"`
	Extra   string      `json:"extra"`
}

InfoNtf Message

func (*InfoNtf) ToString

func (msg *InfoNtf) ToString() (string, error)

ToString InfoNtf

type LBSMsg

type LBSMsg struct {
	Content   string      `json:"content"`
	Extra     string      `json:"extra"`
	POI       string      `json:"poi"`
	Latitude  float64     `json:"latitude"`
	Longitude float64     `json:"longitude"`
	User      MsgUserInfo `json:"user"`
}

LBSMsg Message

func (*LBSMsg) ToString

func (msg *LBSMsg) ToString() (string, error)

ToString LBSMsg

type ListWordFilterResult

type ListWordFilterResult struct {
	Words []SensitiveWord `json:"words"`
}

ListWordFilterResult Result of listWordFilter

type MentionMsgContent

type MentionMsgContent struct {
	Content       string        `json:"content"`
	MentionedInfo MentionedInfo `json:"mentionedInfo"`
}

MentionMsgContent MentionMsgContent

type MentionedInfo

type MentionedInfo struct {
	Type        int      `json:"type"`
	UserIDs     []string `json:"userIdList"`
	PushContent string   `json:"mentionedContent"`
}

MentionedInfo Mentioned

type Message

type Message struct {
	Content    string `json:"content"`    // RongCloud's built-in messages. Please refer to the RCMsg Interface. For custom messages, implement the RCMsg Interface and convert it to a String for passing.
	ObjectName string `json:"objectName"` // RongCloud's built-in messages or custom messages.
}

Message Broadcast message content

type MessageExpansionItem added in v3.2.8

type MessageExpansionItem struct {
	Key       string `json:"key"`
	Value     string `json:"value"`
	Timestamp int64  `json:"timestamp"`
}

type MsgOption added in v3.1.0

type MsgOption func(*msgOptions)

MsgOption interface functions

func WithExtraContent added in v3.2.8

func WithExtraContent(extraContent string) MsgOption

WithExtraContent Custom message extension information, which accepts key-value pairs in JSON string format.

func WithIsAdmin added in v3.2.6

func WithIsAdmin(isAdmin int) MsgOption

Indicates whether the user is an administrator. Default is 0. When set to 1, IMKit will display a gray bar message as "Admin recalled a message" upon receiving this message.

func WithIsDelete added in v3.2.6

func WithIsDelete(isDelete int) MsgOption

Default is 0. When recalling the message, the client will delete the message and replace it with a gray bar recall prompt. When set to 1, the message will be deleted without being replaced by a gray bar prompt.

func WithMsgBusChannel added in v3.2.6

func WithMsgBusChannel(busChannel string) MsgOption

busChannel Creates a sub-conversation

func WithMsgContentAvailable added in v3.1.0

func WithMsgContentAvailable(contentAvailable int) MsgOption

For iOS platform, enables silent push when the SDK is in the background. A push method introduced after iOS7. Allows the app to run a piece of code in the background upon receiving a notification and execute it immediately. 1 represents enabled, 0 represents disabled. Default is 0.

func WithMsgDisablePush added in v3.1.0

func WithMsgDisablePush(isDisablePush bool) MsgOption

disablePush Boolean Indicates whether it is a silent message. Default is false. When set to true, the end user will not receive a notification reminder when offline.

func WithMsgExpansion added in v3.1.0

func WithMsgExpansion(isExpansion bool) MsgOption

Indicates whether the message is extensible. Default is false. When set to true, the client can set extended information upon receiving the message.

func WithMsgIsCounted added in v3.2.21

func WithMsgIsCounted(isCounted int) MsgOption

WithMsgIsCounted Specifies whether to count the message as unread when the user is offline. 0 means not counted, 1 means counted. Default is 1.

func WithMsgMentioned added in v3.1.0

func WithMsgMentioned(isMentioned int) MsgOption

Indicates whether the message is a mention message. 0 represents a normal message, 1 represents a mention message. Default is 0.

func WithMsgPushContent added in v3.1.1

func WithMsgPushContent(pushContent string) MsgOption

pushContent String Defines the displayed push content. If objectName is a built-in message type of RongCloud, the user will definitely receive push information after sending. For custom messages, pushContent is the displayed push content of the custom message. If not provided, the user will not receive a push notification.

func WithMsgPushData added in v3.1.1

func WithMsgPushData(pushData string) MsgOption

pushData String For iOS platform, it is appended to the payload when sending a push notification. The client retrieves the remote push content as appData. RongCloud by default carries the basic message information, which the client can obtain through the 'rc' attribute. For Android clients, the corresponding field name is pushData when receiving push messages.

func WithMsgPushExt added in v3.1.0

func WithMsgPushExt(pushExt string) MsgOption

pushExt String Specifies the push notification attributes. For detailed information, refer to the pushExt structure description. pushExt is in JSON format and requires escaping when making requests. This attribute is invalid when disablePush is true.

func WithMsgVerifyBlacklist added in v3.1.0

func WithMsgVerifyBlacklist(verifyBlacklist int) MsgOption

Specifies whether to filter the sender's blocklist. 0 represents no filtering, 1 represents filtering. Default is 0 (no filtering).

type MsgUserInfo

type MsgUserInfo struct {
	ID       string `json:"id"`
	Name     string `json:"name"`
	Icon     string `json:"icon"`
	Portrait string `json:"portrait"`
	Extra    string `json:"extra"`
}

MsgUserInfo RongCloud built-in message user information

type Notification

type Notification struct {
	Alert   string      `json:"alert"`             // Default push message content. If alert is specified for iOS or Android, the push content will follow the alert for the respective platform. (Required)
	IOS     IOSPush     `json:"ios,omitempty"`     // Settings for iOS platform push and additional information.
	Android AndroidPush `json:"android,omitempty"` // Settings for Android platform push and additional information.
}

Notification Push message content by operating system type. If platform is set to push messages to both iOS and Android, but notification only sets iOS push content, the Android push content will default to the initial alert setting. (Required)

type PlatForm

type PlatForm string

PlatForm Broadcast type

const (
	// IOSPlatForm Broadcast
	IOSPlatForm PlatForm = "ios"
	// AndroidPlatForm Broadcast
	AndroidPlatForm PlatForm = "android"
)

type ProfileNtf

type ProfileNtf struct {
	Operation string      `json:"operation"`
	Data      string      `json:"data"`
	User      MsgUserInfo `json:"user"`
	Extra     string      `json:"extra"`
}

ProfileNtf message

func (*ProfileNtf) ToString

func (msg *ProfileNtf) ToString() (string, error)

ToString ProfileNtf

type Push

type Push struct {
	PlatForm     []PlatForm   `json:"platform"`     // Target operating systems. At least one of iOS or Android must be specified. If you need to push messages to both systems, both must be filled. (Required)
	Audience     Audience     `json:"audience"`     // Push conditions, including: tag, userid, packageName, is_to_all. (Required)
	Notification Notification `json:"notification"` // Push message content by operating system type. If platform is set to push messages to both iOS and Android, but notification only sets iOS push content, the Android push content will default to the initial alert setting. (Required)
}

Push Broadcast push

type PushCustomData added in v3.2.12

type PushCustomData struct {
	Platform []string `json:"platform"`
	Audience struct {
		Tag      []string `json:"tag"`
		TagOr    []string `json:"tag_or"`
		Packages string   `json:"packageName"`
		TagItems []struct {
			Tags          []string `json:"tags"`
			IsNot         bool     `json:"isNot"`
			TagsOperator  string   `json:"tagsOperator"`
			ItemsOperator string   `json:"itemsOperator"`
		} `json:"tagItems,omitempty"`
		IsToAll bool `json:"is_to_all"`
	} `json:"audience"`
	Notification struct {
		Title string `json:"title"`
		Alert string `json:"alert"`
		Ios   struct {
			Title            string      `json:"title,omitempty"`
			ContentAvailable int         `json:"contentAvailable"`
			Badge            int         `json:"badge,omitempty"`
			ThreadId         string      `json:"thread-id"`
			ApnsCollapseId   string      `json:"apns-collapse-id"`
			Category         string      `json:"category,omitempty"`
			RichMediaUri     string      `json:"richMediaUri,omitempty"`
			Extras           interface{} `json:"extras"`
		} `json:"ios"`
		Android struct {
			Hw struct {
				ChannelId  string `json:"channelId"`
				Importance string `json:"importance"`
				Image      string `json:"image"`
			} `json:"hw"`
			Mi struct {
				ChannelId    string `json:"channelId"`
				LargeIconUri string `json:"large_icon_uri"`
			} `json:"mi"`
			Oppo struct {
				ChannelId string `json:"channelId"`
			} `json:"oppo"`
			Vivo struct {
				Classification string `json:"classification"`
			} `json:"vivo"`
			Extras struct {
				Id   string `json:"id"`
				Name string `json:"name"`
			} `json:"extras"`
		} `json:"android"`
	} `json:"notification"`
}

type PushCustomObj added in v3.2.12

type PushCustomObj struct {
	// Return code, 200 indicates success.
	Code int `json:"code"`

	// Unique identifier for the push notification.
	Id string `json:"id"`
}

PushCustomObj : The return value of the PushCustomResObj method

type PushExt added in v3.2.8

type PushExt struct {
	Title                string                         `json:"title,omitempty"`
	TemplateId           string                         `json:"templateId,omitempty"`
	ForceShowPushContent int                            `json:"forceShowPushContent,omitempty"`
	PushConfigs          []map[string]map[string]string `json:"pushConfigs,omitempty"`
}

type PushNotification added in v3.2.8

type PushNotification struct {
	Title       string                 `json:"title,omitempty"`   // Title The title displayed in the notification bar, with a maximum of 50 characters.
	PushContent string                 `json:"pushContent"`       // PushContent The content of the push notification.
	IOS         IOSPush                `json:"ios,omitempty"`     // IOS Settings for push notifications and additional information on the iOS platform. For details, refer to the ios structure description.
	Android     map[string]interface{} `json:"android,omitempty"` // Android Settings for push notifications and additional information on the Android platform. For details, refer to the android structure description.
}

type PushPeriodGet added in v3.2.13

type PushPeriodGet struct {
	Code int `json:"code"`
	Data struct {
		StartTime string `json:"startTime"`
		Period    int    `json:"period"`
		Level     int    `json:"unPushLevel"`
	}
}

type PushResult

type PushResult struct {
	*CodeResult
	ID string `json:"id"`
}

PushResult Return value of the Send function

type Region added in v3.3.0

type Region struct {
	// contains filtered or unexported fields
}

type RespDataArray added in v3.2.8

type RespDataArray struct {
	Code int                                 `json:"code"`
	Data map[string][]map[string]interface{} `json:"data"`
}

API response, data array

type RespDataKV added in v3.2.8

type RespDataKV struct {
	Code int                    `json:"code"`
	Data map[string]interface{} `json:"data"`
}

API response, data

type RongCloud

type RongCloud struct {
	// contains filtered or unexported fields
}

RongCloud appKey appSecret extra

func GetRongCloud

func GetRongCloud() *RongCloud

GetRongCloud retrieves the RongCloud object

func NewRongCloud

func NewRongCloud(appKey, appSecret string, region Region, options ...rongCloudOption) *RongCloud

NewRongCloud creates a RongCloud object

func (*RongCloud) AddWhiteList

func (rc *RongCloud) AddWhiteList(userId string, whiteList []string) error

*

  • @name: AddWhiteList
  • @test:
  • @msg: Add a user to the allowlist (limited to 100 requests per second)
  • @param string userId
  • @param []string whiteList
  • @return: error

func (*RongCloud) BlacklistAdd

func (rc *RongCloud) BlacklistAdd(id string, blacklist []string) error

BlacklistAdd Adds users to the blocklist (limited to 100 times per second)

*@param id: User ID. *@param blacklist: List of users to be added to the blocklist. * *@return error

func (*RongCloud) BlacklistGet

func (rc *RongCloud) BlacklistGet(id string) (BlacklistResult, error)

BlocklistGet Retrieves the blocklist of a user (limited to 100 requests per second)

*@param id: User ID. * *@return BlocklistResult error

func (*RongCloud) BlacklistRemove

func (rc *RongCloud) BlacklistRemove(id string, blacklist []string) error

BlacklistRemove Removes users from the blocklist (limited to 100 times per second)

*@param id: User ID. *@param blacklist: List of users to be removed from the blocklist. * *@return error

func (*RongCloud) BlockAdd

func (rc *RongCloud) BlockAdd(id string, minute uint64) error

BlockAdd Adds a user to the blocklist

*@param id: User ID. *@param minute: Ban duration, 1 - 1 * 30 * 24 * 60 minutes, maximum value is 43200 minutes * *@return error

func (*RongCloud) BlockGetList

func (rc *RongCloud) BlockGetList() (BlockListResult, error)

BlockGetList Get the blocklist of a user

*@return QueryBlockUserResult error

func (*RongCloud) BlockRemove

func (rc *RongCloud) BlockRemove(id string) error

BlockRemove Remove a user from the blocklist

*@param id: User ID. * *@return error

func (*RongCloud) ChangeURI added in v3.1.2

func (rc *RongCloud) ChangeURI()

changeURI automatically switches the API server address

func (*RongCloud) ChatRoomBan added in v3.2.19

func (rc *RongCloud) ChatRoomBan(chatroomId string, options ...ChatroomOption) error

Mute all users in the chatroom

func (*RongCloud) ChatRoomBanAdd

func (rc *RongCloud) ChatRoomBanAdd(members []string, minute uint, options ...ChatroomOption) error

ChatRoomBanAdd Add a global mute for the chatroom

*@param  members: The list of members, with a maximum of 20.

*@param  minute: Mute duration, range: 1 - 1 * 30 * 24 * 60 minutes.
*
*@return error

func (*RongCloud) ChatRoomBanCheck added in v3.2.19

func (rc *RongCloud) ChatRoomBanCheck(chatroomId string) (bool, error)

Check the mute all status of a chatroom

func (*RongCloud) ChatRoomBanGetList

func (rc *RongCloud) ChatRoomBanGetList() ([]ChatRoomUser, error)

ChatRoomBanGetList Get the list of globally muted users in the chatroom

*@return []ChatRoomUser error

func (*RongCloud) ChatRoomBanQuery added in v3.2.19

func (rc *RongCloud) ChatRoomBanQuery(size, page int) ([]string, error)

Query the list of muted chatrooms

func (*RongCloud) ChatRoomBanRemove

func (rc *RongCloud) ChatRoomBanRemove(members []string, options ...ChatroomOption) error

ChatRoomBanRemove Unmute all chatrooms

*@param  members: Member list, up to 20 members.
*
*@return error

func (*RongCloud) ChatRoomBanRollback added in v3.2.19

func (rc *RongCloud) ChatRoomBanRollback(chatroomId string, options ...ChatroomOption) error

Rollback mute all chatrooms

func (*RongCloud) ChatRoomBlockAdd

func (rc *RongCloud) ChatRoomBlockAdd(id string, members []string, minute uint, options ...ChatroomOption) error

ChatRoomBlockAdd adds members to the chatroom blocklist *

*
* @param id: The ID of the chatroom.
* @param members: A list of members to be blocked.
* @param minute: The duration of the block in minutes, with a maximum value of 43200 minutes.
*
* @return error

func (*RongCloud) ChatRoomBlockGetList

func (rc *RongCloud) ChatRoomBlockGetList(id string) (ChatRoomResult, error)

ChatRoomBlockGetList Query the list of banned chatroom members

*@param  id: The ID of the chatroom.
*
*@return ChatRoomResult error

func (*RongCloud) ChatRoomBlockRemove

func (rc *RongCloud) ChatRoomBlockRemove(id string, members []string, options ...ChatroomOption) error

ChatRoomBlockRemove Remove banned users from the chatroom

*
*@param  id: Chatroom ID.
*@param  members: List of users.
*
*@return error

func (*RongCloud) ChatRoomBroadcast

func (rc *RongCloud) ChatRoomBroadcast(senderID, objectName string, msg rcMsg, isIncludeSender ...string) error

ChatRoomBroadcast Broadcasts a message to all chatrooms in the application. This feature requires the Dedicated Cloud service. (Sends a message as a user to a group, with a maximum message size of 128k. The maximum sending rate is 20 messages per second.)

*@param senderID: The sender's user ID. *@param objectName: The message type. *@param msg: The message content. * @param isIncludeSender: 0 or 1. *@return error

func (*RongCloud) ChatRoomCreate

func (rc *RongCloud) ChatRoomCreate(id, name string) error

ChatRoomCreate Create a chatroom

*@param  id: the ID of the chatroom to create;
*@param  name: the name of the chatroom to create.
*
*@return error

func (*RongCloud) ChatRoomCreateNew added in v3.2.20

func (rc *RongCloud) ChatRoomCreateNew(chatroomId string, options ...ChatroomOption) error

Create a chatroom

func (*RongCloud) ChatRoomDemotionAdd

func (rc *RongCloud) ChatRoomDemotionAdd(objectNames []string) error

ChatRoomDemotionAdd Add chatroom message priority

  • @param objectName: List of message types, up to 20.
  • @return err

func (*RongCloud) ChatRoomDemotionGetList

func (rc *RongCloud) ChatRoomDemotionGetList() ([]string, error)

ChatRoomDemotionGetList Get the list of downgraded messages in the chatroom

  • @return []string error

func (*RongCloud) ChatRoomDemotionRemove

func (rc *RongCloud) ChatRoomDemotionRemove(objectNames []string) error

ChatRoomDemotionRemove Remove the downgraded messages in the chatroom

  • @param objectName: List of message types.
  • @return err

func (*RongCloud) ChatRoomDestroy

func (rc *RongCloud) ChatRoomDestroy(id string) error

ChatRoomDestroy Destroys a chatroom *

*
*@param  id: The ID of the chatroom to be destroyed.
*
*@return error

func (*RongCloud) ChatRoomDestroySet added in v3.2.20

func (rc *RongCloud) ChatRoomDestroySet(chatroomId string, destroyType, destroyTime int) error

Set the chatroom destruction type

func (*RongCloud) ChatRoomDistributionResume

func (rc *RongCloud) ChatRoomDistributionResume(id string) error

ChatRoomDistributionResume Resumes message distribution in a chatroom

  • @param id: The chatroom ID.
  • @return error

func (*RongCloud) ChatRoomDistributionStop

func (rc *RongCloud) ChatRoomDistributionStop(id string) error

ChatRoomDistributionStop Stops message distribution in a chatroom (This method allows you to control whether messages in a chatroom are distributed. Once distribution is stopped, messages sent by users in the chatroom will not be forwarded to other users by the RongCloud server.)

  • @param id: The chatroom ID.
  • @return error

func (*RongCloud) ChatRoomEntryBatchSet added in v3.2.20

func (rc *RongCloud) ChatRoomEntryBatchSet(chatroomId string, autoDelete int, entryOwnerId string, entryInfo map[string]interface{}) error

Batch set chatroom custom attributes (KV)

func (*RongCloud) ChatRoomEntryQuery

func (rc *RongCloud) ChatRoomEntryQuery(chatRoomID string, keys ...string) ([]ChatRoomAttr, error)

ChatRoomEntryQuery Query custom attributes of a chatroom *

  • @param ChatRoomID The ID of the chatroom
  • @param keys Specify the keys to retrieve from the chatroom. Up to 100 keys can be specified. If empty, all keys will be retrieved. *
  • @return []ChatRoomAttr List of attributes
  • @return error Error

func (*RongCloud) ChatRoomEntryRemove

func (rc *RongCloud) ChatRoomEntryRemove(chatRoomID, userID, key string) error

ChatRoomEntryRemove Remove custom attributes of a chatroom *

  • @param chatRoomID The ID of the chatroom
  • @param userID The ID of the user performing the operation. It can be set by a non-chatroom user via Server API.
  • @param key The name of the chatroom attribute. The key supports a combination of uppercase and lowercase letters, numbers, and special characters + = - _. It is case-sensitive with a maximum length of 128 characters. *
  • @return error

func (*RongCloud) ChatRoomEntrySet

func (rc *RongCloud) ChatRoomEntrySet(chatRoomID, userID, key, value string, autoDelete bool) error

ChatRoomEntrySet Sets custom attributes for a chatroom *

  • @param chatRoomID The ID of the chatroom
  • @param userID The ID of the user performing the operation. Can be set via Server API by non-chatroom users.
  • @param key The name of the chatroom attribute. Supports uppercase and lowercase letters, numbers, and special characters + = - _. Case sensitive. Maximum length: 128 characters
  • @param value The value of the chatroom attribute. Maximum length: 4096 characters
  • @param autoDelete Whether to delete this key after the user exits the chatroom. true: delete this key; false: do not delete this key after the user exits *
  • @retrun error

func (*RongCloud) ChatRoomGagAdd

func (rc *RongCloud) ChatRoomGagAdd(id string, members []string, minute uint, options ...ChatroomOption) error

ChatRoomGagAdd Mute a user in the chatroom (In the App, if you do not want a specific user to send messages in the chatroom, you can mute the user. The muted user can still receive and view messages in the chatroom but cannot send messages.)

*
*@param  id: Chatroom ID.
*@param  members: List of users to be muted.
*@param  minute: Duration of the mute in minutes, with a maximum value of 43200 minutes. (Required)
*
*@return error

func (*RongCloud) ChatRoomGagGetList

func (rc *RongCloud) ChatRoomGagGetList(id string) ([]ChatRoomUser, error)

ChatRoomGagGetList Query the list of muted chatroom members

  • @param id: Chatroom ID. (Required) *
  • @return []ChatRoomUser error

func (*RongCloud) ChatRoomGagRemove

func (rc *RongCloud) ChatRoomGagRemove(id string, members []string, options ...ChatroomOption) error

ChatRoomGagRemove Remove the gag from chatroom members

  • @param id: The ID of the chatroom.
  • @param members: The list of members to remove the gag from. *
  • @return error

func (*RongCloud) ChatRoomGet

func (rc *RongCloud) ChatRoomGet(id string, count, order int) (ChatRoomResult, error)

ChatRoomGet Query chatroom members

*@param  id: The ID of the chatroom to query.
*@param  count: The number of chatroom members to retrieve, with a maximum limit of 500. If exceeded, only 500 members will be returned.
*@param  order: The order in which members joined the chatroom. 1 for ascending order by join time, 2 for descending order by join time.
*
*@return ChatRoomResult error

func (*RongCloud) ChatRoomGetNew added in v3.2.20

func (rc *RongCloud) ChatRoomGetNew(chatroomId string) (ChatRoomGetResult, error)

Query chatroom information

func (*RongCloud) ChatRoomIsExist

func (rc *RongCloud) ChatRoomIsExist(id string, members []string) ([]ChatRoomUser, error)

ChatRoomIsExist checks if users exist in a chatroom

  • @param id: The ID of the chatroom to query.
  • @param members: A list of members to check, with a maximum of 1000 members per request. *
  • @return ChatRoomResult error

func (*RongCloud) ChatRoomKeepAliveAdd

func (rc *RongCloud) ChatRoomKeepAliveAdd(id string) error

ChatRoomKeepAliveAdd Add a chatroom to keepalive list

*@param  id: Chatroom ID.
*@return error

func (*RongCloud) ChatRoomKeepAliveGetList

func (rc *RongCloud) ChatRoomKeepAliveGetList() ([]string, error)

ChatRoomKeepAliveGetList Get the list of keepalive chatrooms

*@param  id: Chatroom ID.

*@return []string error

func (*RongCloud) ChatRoomKeepAliveRemove

func (rc *RongCloud) ChatRoomKeepAliveRemove(id string) error

ChatRoomKeepAliveRemove Remove a chatroom from keepalive list

*@param  id: Chatroom ID.
*@return error

func (*RongCloud) ChatRoomMuteMembersAdd

func (rc *RongCloud) ChatRoomMuteMembersAdd(id string, members []string, minute uint, options ...ChatroomOption) error

ChatRoomMuteMembersAdd Adds muted members to a chatroom (In the app, if you want to prevent a user from sending messages in a chatroom, you can mute the user. Muted users can still receive and view messages in the chatroom but cannot send messages.)

*
*@param  id: The chatroom ID.
*@param  members: The list of users to be muted.
*@param  minute: The duration of the mute in minutes, with a maximum value of 43200 minutes. (Required)
*
*@return error

func (*RongCloud) ChatRoomMuteMembersGetList

func (rc *RongCloud) ChatRoomMuteMembersGetList(id string) ([]ChatRoomUser, error)

ChatRoomMuteMembersGetList Retrieves the list of muted members in a chatroom.

*@param id: The ID of the chatroom. (Required) * *@return []ChatRoomUser error

func (*RongCloud) ChatRoomMuteMembersRemove

func (rc *RongCloud) ChatRoomMuteMembersRemove(id string, members []string, options ...ChatroomOption) error

ChatRoomMuteMembersRemove Removes muted members from the chatroom

*@param  id: The ID of the chatroom.
*@param  members: List of members to unmute
*
*@return error

func (*RongCloud) ChatRoomQuery

func (rc *RongCloud) ChatRoomQuery(chatRoomID []string) ([]ChatRoom, error)

ChatRoomQuery Query basic information of a chatroom *

  • @param chatRoomID The ID of the chatroom to query

  • @return []ChatRoom Array of chatroom information

  • @return error Error message *

func (*RongCloud) ChatRoomRecall

func (rc *RongCloud) ChatRoomRecall(userId string, targetId string, messageId string, sentTime int,
	options ...MsgOption) error

*

  • @name: ChatRoomRecall
  • @test:
  • @msg: Message Recall - Chatroom
  • @param string userId
  • @param string targetId
  • @param string messageId
  • @param int sentTime
  • @param int isAdmin
  • @param int isDelete
  • @param bool disablePush
  • @return: error

func (*RongCloud) ChatRoomSend

func (rc *RongCloud) ChatRoomSend(senderID string, targetID []string, objectName string, msg rcMsg, isPersisted, isIncludeSender int) error

ChatRoomSend sends a message to a chatroom. (A user can send a message to a group. The maximum size of a single message is 128k. A user can send up to 20 messages per second and up to 3 groups at a time. For example, sending a message to 3 groups counts as 3 messages.)

*@param  senderID: The sender's user ID.
*@param  targetID: The target chatroom IDs. It is recommended not to exceed 10 chatrooms.
*@param  objectName: The message type.
*@param  msg: The message content.
*
*@return error

func (*RongCloud) ChatRoomUserBanWhitelistAdd added in v3.2.19

func (rc *RongCloud) ChatRoomUserBanWhitelistAdd(chatroomId string, members []string, options ...ChatroomOption) error

Add users to the chatroom mute exceptions list

func (*RongCloud) ChatRoomUserBanWhitelistQuery added in v3.2.19

func (rc *RongCloud) ChatRoomUserBanWhitelistQuery(chatroomId string) ([]string, error)

Query the chatroom mute exceptions list

func (*RongCloud) ChatRoomUserBanWhitelistRollback added in v3.2.19

func (rc *RongCloud) ChatRoomUserBanWhitelistRollback(chatroomId string, members []string, options ...ChatroomOption) error

Remove users from the chatroom mute exceptions list

func (*RongCloud) ChatRoomUserWhitelistAdd

func (rc *RongCloud) ChatRoomUserWhitelistAdd(id string, members []string) error

ChatRoomUserWhitelistAdd Add a user to the chatroom allowlist

*@param  id: Chatroom ID.
*@param  members: The allowlist, with a maximum of 5 members.
*@return error

func (*RongCloud) ChatRoomUserWhitelistGetList

func (rc *RongCloud) ChatRoomUserWhitelistGetList(id string) ([]string, error)

ChatRoomUserWhitelistGetList Get the allowlist of users in a chatroom

  • @param id: The ID of the chatroom.
  • @return []string error

func (*RongCloud) ChatRoomUserWhitelistRemove

func (rc *RongCloud) ChatRoomUserWhitelistRemove(id string, members []string) error

ChatRoomUserWhitelistRemove Removes users from the allowlist

*@param  id: The chatroom ID.
*@param  members: The allowlist, with a maximum of 5 members.
*@return error

func (*RongCloud) ChatRoomWhitelistAdd

func (rc *RongCloud) ChatRoomWhitelistAdd(objectNames []string) error

ChatRoomWhitelistAdd Add a message to the chatroom allowlist

*@param  objectNames: List of message types.
*@return error

func (*RongCloud) ChatRoomWhitelistGetList

func (rc *RongCloud) ChatRoomWhitelistGetList() ([]string, error)

ChatRoomWhitelistGetList Get the chatroom message allowlist

*@return []string error

func (*RongCloud) ChatRoomWhitelistRemove

func (rc *RongCloud) ChatRoomWhitelistRemove(objectNames []string) error

ChatRoomWhitelistRemove Remove a message from the chatroom allowlist

*@param  objectNames: List of message types.
*@return error

func (*RongCloud) ChatUserExist added in v3.2.12

func (rc *RongCloud) ChatUserExist(chatroomId, userId string) ([]byte, error)

ChatUserExist :/chatroom/user/exist.json Check if a user has joined a chatroom *

@param: chatroomId, the ID of the chatroom to query
@param: userId, the ID of the user to query
response: byte array

*//

func (*RongCloud) ChatUserExistResObj added in v3.2.12

func (rc *RongCloud) ChatUserExistResObj(chatroomId, userId string) (ChatUserExistObj, error)

ChatUserExistResObj :/chatroom/user/exist.json Check if a user has joined a chatroom *

@param: chatroomId, the ID of the chatroom to query
@param: userId, the ID of the user to query
response: ChatUserExistObj

*//

func (*RongCloud) ConversationGet

func (rc *RongCloud) ConversationGet(conversationType ConversationType, userID, targetID string,
	options ...MsgOption) (int, error)

ConversationGet Get Conversation Do Not Disturb Status

* @param conversationType: Conversation type, can be PRIVATE, GROUP, DISCUSSION, or SYSTEM. * @param userID: User ID to set. * @param targetID: Target ID to be muted. * * @return int error

func (*RongCloud) ConversationMute

func (rc *RongCloud) ConversationMute(conversationType ConversationType, userID, targetID string,
	options ...MsgOption) error

ConversationMute Mutes push notifications for a specific conversation of a user.

*@param conversationType: Specifies the conversation type: PRIVATE, GROUP, DISCUSSION, SYSTEM. *@param userID: The user ID for whom the conversation is being muted. *@param targetID: The target ID of the conversation to be muted. * *@return error

func (*RongCloud) ConversationNotificationGet added in v3.2.8

func (rc *RongCloud) ConversationNotificationGet(ct ConversationType, requestId, targetId, busChannel string) (int, error)

ConversationNotificationGet Retrieves the Do Not Disturb status for a specified conversation

func (*RongCloud) ConversationNotificationSet added in v3.2.8

func (rc *RongCloud) ConversationNotificationSet(ct ConversationType, requestId, targetId, busChannel string, isMuted, unPushLevel int) error

ConversationNotificationSet Sets the Do Not Disturb status for a specified conversation

func (*RongCloud) ConversationTop added in v3.2.9

func (rc *RongCloud) ConversationTop(conversationType ConversationType, userId, targetId, setTop string) error

ConversationTop : Pin a conversation * @param userId : Required User ID, the user to whom the conversation belongs @param conversationType: Optional Conversation type. Supported conversation types include: 1 (one-to-one chat), 3 (group chat), 6 (system conversation). @param targetId: Required Target ID to be set, which varies depending on the conversation type (user ID for one-to-one chat, group ID for group chat, system target ID for system conversation). @param setTop : Required true to pin, false to unpin.

@return error */

func (*RongCloud) ConversationTypeNotificationGet added in v3.2.8

func (rc *RongCloud) ConversationTypeNotificationGet(ct ConversationType, requestId string) (int, error)

ConversationTypeNotificationGet Queries the Do Not Disturb status for a specified conversation type (one-to-one chat, group chat, ultra group, system message) of a user.

func (*RongCloud) ConversationTypeNotificationSet added in v3.2.8

func (rc *RongCloud) ConversationTypeNotificationSet(ct ConversationType, requestId string, unPushLevel int) error

ConversationTypeNotificationSet Sets the Do Not Disturb status for a specific conversation type (one-to-one chat, group chat, ultra group, system message).

func (*RongCloud) ConversationUnmute

func (rc *RongCloud) ConversationUnmute(conversationType ConversationType, userID, targetID string,
	options ...MsgOption) error

ConversationUnmute Sets the user to receive push notifications for a specific conversation

*@param conversationType: Conversation type, PRIVATE, GROUP, DISCUSSION, SYSTEM. *@param userID: The user ID to set. *@param targetID: The target ID to unmute. * *@return error

func (*RongCloud) DeleteMessageExpansion added in v3.2.8

func (rc *RongCloud) DeleteMessageExpansion(msgUID, userId, conversationType, targetId string, isSyncSender int, keys ...string) error

DeleteMessageExpansion Deletes message expansion

func (*RongCloud) GetHttpTransport added in v3.2.0

func (rc *RongCloud) GetHttpTransport() http.RoundTripper

func (*RongCloud) GroupCreate

func (rc *RongCloud) GroupCreate(id, name string, members []string) error

GroupCreate Creates a group and adds users to it. Users will receive messages from this group. A single user can join up to 500 groups, and each group can have up to 3000 members. There is no limit to the number of groups within an App. Note: This method is an alias for the /group/join method.

*@param  id: The group ID, with a maximum length of 30 characters. It is recommended to use a combination of letters and numbers.
*@param  name: The group name, with a maximum length of 60 characters.
*@param  members: The list of users to be added to the group.
*
*@return error

func (*RongCloud) GroupDismiss

func (rc *RongCloud) GroupDismiss(id, member string) error

GroupDismiss Dismiss group method

*@param  id: Group ID, maximum length of 30 characters, recommended to use a mix of letters and numbers.
*@param  member: Group owner or administrator.

*
*@return error

func (*RongCloud) GroupGagAdd

func (rc *RongCloud) GroupGagAdd(id string, members []string, minute int) error

GroupGagAdd Adds a muted group member (In the app, if you don't want a user to speak in the group, you can mute the user in the group. The muted user can receive and view group chat messages but cannot send messages.)

*@param id: Group ID. *@param members: List of muted group members. *@param minute: Mute duration in minutes, with a maximum value of 43200 minutes. * *@return error

func (*RongCloud) GroupGagList

func (rc *RongCloud) GroupGagList(id string) (Group, error)

GroupGagList Queries the list of muted members in a group.

*@param id: The group ID.

*@return Group error

func (*RongCloud) GroupGagRemove

func (rc *RongCloud) GroupGagRemove(id string, members []string) error

GroupGagRemove Removes the gag from group members

*@param id: The group ID. *@param members: The list of group members to un-gag. * *@return error

func (*RongCloud) GroupGet

func (rc *RongCloud) GroupGet(id string) (Group, error)

GroupGet Queries the members of a group.

*@param  id: The ID of the group.
*
*@return Group error

func (*RongCloud) GroupJoin

func (rc *RongCloud) GroupJoin(groupId, groupName string, memberId ...string) error

GroupJoin Adds users to a specified group in batch, enabling them to receive messages from the group.

*@param  groupId: The ID of the group to join.
*@param  groupName: The name of the group, with a maximum length of 60 characters.
*@param  memberId: The users to be added to the group, with a maximum of 1000 users.
*
*@return error

func (*RongCloud) GroupMuteAllMembersAdd

func (rc *RongCloud) GroupMuteAllMembersAdd(members []string) error

GroupMuteAllMembersAdd Mutes all members in a group, preventing them from sending messages. If certain users need to be allowed to send messages, they can be added to the group's mute exceptions list.

*@param members: List of group members to be muted. * *@return error

func (*RongCloud) GroupMuteAllMembersGetList

func (rc *RongCloud) GroupMuteAllMembersGetList(groupIds []string, page int, size int) (GroupInfo, error)

GroupMuteAllMembersGetList Query the mute list for all groups

*@param groupIds: Group ID. You can specify one or multiple groups in a single query, with a maximum of 20 groups per query. *@param page: Page number. If this parameter is passed, the groupId parameter becomes invalid. If the groupId parameter is not passed, the default value is 1. *@param size: Number of items per page. If this parameter is passed, the groupId parameter becomes invalid. If the groupId parameter is not passed, the default value is 50, with a maximum of 200. * *@return Group error

func (*RongCloud) GroupMuteAllMembersRemove

func (rc *RongCloud) GroupMuteAllMembersRemove(members []string) error

func (*RongCloud) GroupMuteMembersAdd

func (rc *RongCloud) GroupMuteMembersAdd(id string, members []string, minute int) error

GroupMuteMembersAdd Adds a list of members to the group mute list (In the app, if you want to prevent a user from sending messages in the group, you can mute the user in the group. Muted users can receive and view group messages but cannot send messages.)

*@param id: The group ID. *@param members: The list of members to be muted. *@param minute: The duration of the mute in minutes, with a maximum value of 43200 minutes. * *@return error

func (*RongCloud) GroupMuteMembersGetList

func (rc *RongCloud) GroupMuteMembersGetList(id string) (Group, error)

GroupMuteMembersGetList Retrieves the list of muted group members

*@param id: Group ID. * *@return Group error

func (*RongCloud) GroupMuteMembersRemove

func (rc *RongCloud) GroupMuteMembersRemove(id string, members []string) error

GroupMuteMembersRemove Removes the mute from group members

*@param id: The group ID. *@param members: The list of group members to un-mute. * *@return error

func (*RongCloud) GroupMuteWhiteListUserAdd

func (rc *RongCloud) GroupMuteWhiteListUserAdd(id string, members []string) error

GroupMuteWhiteListUserAdd When a group is muted, if certain users need to be allowed to speak, you can add them to the group's mute allowlist. The group mute allowlist only takes effect when the group is set to mute all members.

*@param id: Group ID. *@param members: List of members to be allowed to speak. * *@return error

func (*RongCloud) GroupMuteWhiteListUserGetList

func (rc *RongCloud) GroupMuteWhiteListUserGetList(id string) ([]string, error)

GroupMuteWhiteListUserGetList Query the allowlist of muted users in a group.

*@param id: The group ID. * *@return error

func (*RongCloud) GroupMuteWhiteListUserRemove

func (rc *RongCloud) GroupMuteWhiteListUserRemove(id string, members []string) error

GroupMuteWhiteListUserRemove Remove users from the group mute allowlist.

*@param id: Group ID. *@param members: List of members to be removed from the allowlist. * *@return error

func (*RongCloud) GroupQuit

func (rc *RongCloud) GroupQuit(member []string, id string) error

GroupQuit Batch exit group method (Remove users from the group, they will no longer receive messages from this group.)

*@param  id: The group ID to exit.
*@param  member: The group members to exit, with a maximum of 1000 members.
*
*@return error

func (*RongCloud) GroupRecall

func (rc *RongCloud) GroupRecall(senderID, targetID, uID string, sentTime int,
	options ...MsgOption) error

GroupRecall Recall a group chat message

* @param senderID: The sender's user ID. * @param targetID: The recipient's user ID. * @param uID: The unique identifier of the message, returned by the SDK after the message is sent successfully. * @param sentTime: The timestamp when the message was sent, returned by the SDK after the message is sent successfully. * @param int isAdmin * @param int isDelete * @param bool disablePush * @return error

func (*RongCloud) GroupRemarksDel added in v3.2.11

func (rc *RongCloud) GroupRemarksDel(userId string, groupId string) error

GroupRemarksDel :/group/remarks/del.json Delete the push alias of a group member * @param : userId : The user ID of the group member @param : groupId : The group ID

*/

func (*RongCloud) GroupRemarksGet added in v3.2.11

func (rc *RongCloud) GroupRemarksGet(userId string, groupId string) ([]byte, error)

GroupRemarksGet :/group/remarks/get.json Query the push remark name of a group member * @param : userId : The user ID of the group member @param : groupId : The group ID response : Byte array Documentation: https://doc.rongcloud.cn/imserver/server/v1/group/get-remark-for-group-push */

func (*RongCloud) GroupRemarksGetResObj added in v3.2.12

func (rc *RongCloud) GroupRemarksGetResObj(userId string, groupId string) (GroupRemarksGetObj, error)

GroupRemarksGetResObj : /group/remarks/get.json Query the push alias name for a group member * @param : userId : The user ID of the group member @param : groupId : The group ID response : byte array Documentation: https://doc.rongcloud.cn/imserver/server/v1/group/get-remark-for-group-push */

func (*RongCloud) GroupRemarksSet added in v3.2.11

func (rc *RongCloud) GroupRemarksSet(userId string, groupId string, remark string) error

GroupRemarksSet :/group/remarks/set.json Set the push alias for a specific group member * @param : userId : The user ID of the group member @param : groupId : The group ID @param : remark : The push alias for the group member

*/

func (*RongCloud) GroupSend

func (rc *RongCloud) GroupSend(senderID string, targetID, userID []string, objectName string, msg rcMsg,
	pushContent string, pushData string, isPersisted, isIncludeSender int, options ...MsgOption) error

GroupSend Sends a group message (sends a message to a group as a user. The maximum size of a single message is 128k. The maximum number of messages that can be sent per second is 20. The maximum number of groups that can be sent to at a time is 3. For example, sending a message to 3 groups counts as 3 messages.)

  • @param senderID: The sender's user ID.
  • @param targetID: The target group ID.
  • @param objectName: The message type.
  • @param userID: The targeted message feature allows sending messages to one or more specified users in the group, while other users in the group will not receive the message. This parameter is valid when targetID is a group. Note: If the "Cloud Storage for One-to-One and Group Messages" feature is enabled, targeted messages will not be stored in the cloud. This feature can be used when sending read receipts to some users in the group. (Optional)
  • @param msg: The message content to be sent.
  • @param pushContent: Defines the displayed Push content. If the objectName is a built-in RongCloud message type, the user will definitely receive a Push notification after sending. If it is a custom message, pushContent is the displayed Push content of the custom message. If this parameter is not provided, the user will not receive a Push notification.
  • @param pushData: For iOS platforms, this is the additional data attached to the Push notification payload. For Android clients, the corresponding field name is pushData.
  • @param isPersisted: When the current version has a new custom message and the old version does not have this custom message, this parameter determines whether the old version client will store the message after receiving it. 0 means not to store, 1 means to store. The default is 1 (store the message).
  • @param isIncludeSender: Whether the sender will receive the message. 0 means not to receive, 1 means to receive. The default is 0 (not to receive).
  • @param options: Other extended parameters needed for sending the message. *
  • @return error

func (*RongCloud) GroupSendMention

func (rc *RongCloud) GroupSendMention(senderID string, targetID []string, objectName string, msg MentionMsgContent,
	pushContent, pushData string, isPersisted, isIncludeSender, isMentioned, contentAvailable int, options ...MsgOption) error

GroupSendMention Sends a group @ message

  • @param senderID: The sender's user ID.
  • @param targetID: The recipient group ID, with a maximum of 3 groups.
  • @param objectName: The message type.
  • @param msg: The message content to be sent.
  • @param pushContent: Defines the push notification content to be displayed. If the objectName is a built-in RongCloud message type, the user will always receive a push notification. For custom messages, pushContent defines the push notification content. If not provided, the user will not receive a push notification.
  • @param pushData: For iOS platforms, this is additional data attached to the push notification payload. For Android clients, the corresponding field name is pushData.
  • @param isPersisted: Determines whether older versions of the client store the message when a new custom message type is introduced. 0 means do not store, 1 means store. Default is 1.
  • @param isIncludeSender: Determines whether the sender also receives the message. 0 means do not receive, 1 means receive. Default is 0.
  • @param isMentioned: Indicates whether this is an @ message. 0 means a regular message, 1 means an @ message. Default is 0. When set to 1, the content parameter must include mentionedInfo with the detailed content of the @ message. When set to 0, mentionedInfo is not required. If toUserId is specified, the @ user must be included in toUserId.
  • @param contentAvailable: For iOS platforms, this enables silent push notifications when the SDK is in the background. This is a push method introduced in iOS7 that allows the app to execute code in the background upon receiving the notification. 1 means enabled, 0 means disabled. Default is 0. *
  • @return error

func (*RongCloud) GroupStatusSend added in v3.2.6

func (rc *RongCloud) GroupStatusSend(senderID string, toGroupIds []string, objectName string, msg rcMsg,
	verifyBlacklist int, isIncludeSender int, options ...MsgOption) error

Send group status message senderID: The sender's user ID. toGroupIds: The recipient group IDs. Providing multiple parameters allows sending messages to multiple groups, with a maximum of 3 groups. objectName: The message type. msg: The content of the message to be sent. verifyBlacklist: Whether to filter the sender's blocklist. 0 indicates no filtering, 1 indicates filtering. Default is 0 (no filtering). isIncludeSender: Whether the sender should receive the message. 0 indicates not receiving, 1 indicates receiving. Default is 0 (not receiving).

func (*RongCloud) GroupSync

func (rc *RongCloud) GroupSync(id string, groups []Group) error

GroupSync Synchronizes the groups a user belongs to. This method is used to ensure that the group information of a user in the application is consistent with the information known by RongCloud. It is primarily used when connecting to the RongCloud server for the first time.

*@param  id: The user ID whose group information is to be synchronized. (Required)
*@param  groups: The list of groups the user belongs to.
*
*@return error

func (*RongCloud) GroupUpdate

func (rc *RongCloud) GroupUpdate(id, name string) error

GroupUpdate Refreshes group information

*@param id: Group ID. *@param name: Group name. * *@return error

func (*RongCloud) GroupUserGagAdd added in v3.2.11

func (rc *RongCloud) GroupUserGagAdd(userId string, groupId string, minute string) error

GroupUserGagAdd : Add muted members /group/user/gag/add.json * @param userId: User ID, up to 20 users can be added at a time. @param groupId: Group ID, if empty, the user will be muted in all groups they join. @param minute: Mute duration in minutes, maximum value is 43200 minutes, 0 means permanent mute. */

func (*RongCloud) GroupUserQuery added in v3.2.11

func (rc *RongCloud) GroupUserQuery(userId string) ([]byte, error)

GroupUserQuery : Query all groups that a user has joined based on the user ID, returning the group ID and group name. * @param userId: User ID Documentation: https://doc.rongcloud.cn/imserver/server/v1/group/query-group-by-user */

func (*RongCloud) GroupUserQueryResObj added in v3.2.12

func (rc *RongCloud) GroupUserQueryResObj(userId string) (GroupUserQueryObj, error)

GroupUserQueryResObj : Query all groups that a user has joined based on the user ID, returning the group ID and group name. * @param userId: User ID response: GroupUserQueryObj Documentation: https://doc.rongcloud.cn/imserver/server/v1/group/query-group-by-user */

func (*RongCloud) HistoryGet

func (rc *RongCloud) HistoryGet(date string) (History, error)

HistoryGet retrieves the URL of the historical message log file by hour, which includes all messages generated by the application within that hour. The message log file will be deleted from RongCloud servers after 3 days, regardless of whether it has been downloaded.

* @param date: Specifies the hour, e.g., 2018030210 represents the data generated from 10:00 to 11:00 on March 2, 2018. * * @return History error

func (*RongCloud) HistoryRemove

func (rc *RongCloud) HistoryRemove(date string) error

HistoryRemove Deletes historical message log files

*@param date: Specifies the hour, e.g., 2018030210 represents the data generated from 10:00 to 11:00 on March 2, 2018 * *@return error

func (*RongCloud) MessageBroadcastRecall

func (rc *RongCloud) MessageBroadcastRecall(userId string, objectName string, content BroadcastRecallContent) error

*

  • @name: MessageBroadcastRecall
  • @test:
  • @msg: Broadcast message recall
  • @param string userId
  • @param string objectName
  • @param BroadcastRecallContent content
  • @return: error

func (*RongCloud) MessageExpansionDel added in v3.2.11

func (rc *RongCloud) MessageExpansionDel(msgUID, userId, conversationType, targetId, extraKey string, isSyncSender int) error

MessageExpansionDel : Delete message expansion /message/expansion/delete.json * @param msgUID: The unique identifier of the message, which can be obtained through the full message routing feature. For details, see Post-messaging Callback. @param userId: The user ID of the operator, i.e., the user ID that needs to delete the extended information for the specified message (msgUID). @param conversationType: The type of conversation. Supported conversation types include: 1 (one-to-one chat), 3 (group chat). @param targetId: The target ID, which could be a user ID or group ID depending on the conversationType. @param extraKeyVal: The custom extended content of the message, in JSON format, set as Key-Value pairs, e.g., {"type":"3"}. A single message can have up to 300 extended information items, and a maximum of 100 can be set at once. @param isSyncSender: The operation will generate an "extension operation message". This field specifies whether the sender of the "extension operation message" can receive this message on the client. For details, see https://doc.rongcloud.cn/imserver/server/v1/message/expansion#delete */

func (*RongCloud) MessageExpansionSet added in v3.2.11

func (rc *RongCloud) MessageExpansionSet(msgUID, userId, conversationType, targetId, extraKeyVal string, isSyncSender int) error

MessageExpansionSet : Set message expansion /message/expansion/set.json * @param msgUID: The unique identifier of the message, which can be obtained through the full message routing feature. See full message routing for details. @param userId: The user ID of the operator, i.e., the user ID that needs to set the extended information for the specified message (msgUID). @param conversationType: The conversation type. Supported conversation types include: 1 (one-to-one chat), 3 (group chat). @param targetId: The target ID, which can be a user ID or group ID depending on the conversationType. @param extraKeyVal: The custom extended content of the message, in JSON format, set in Key-Value pairs, e.g., {"type":"3"}. A single message can have up to 300 extended information items, and a maximum of 100 can be set at once. @param isSyncSender: Specifies whether the sender of the "expansion operation message" can receive this message on the client. https://doc.rongcloud.cn/imserver/server/v1/message/expansion#set */

func (*RongCloud) OnlineBroadcast added in v3.2.4

func (rc *RongCloud) OnlineBroadcast(fromUserId string, objectName string, content string) ([]byte, error)

OnlineBroadcast Sends a message to all online users in the application. When users are actively using the app, the message will be displayed in the chat UI and conversation list, with the conversation type set to SYSTEM. @param fromUserId The sender's user ID. @param objectName The message type. @param content The message content.

func (*RongCloud) OnlineStatusCheck

func (rc *RongCloud) OnlineStatusCheck(userID string) (int, error)

* @param userID: User ID, maximum length of 64 bytes. It is the unique identifier of the user within the App, and must be unique within the same App. Duplicate user IDs will be treated as the same user. * * @return int, error

func (*RongCloud) PrivateRecall

func (rc *RongCloud) PrivateRecall(senderID, targetID, uID string, sentTime int,
	options ...MsgOption) error

PrivateRecall is used to recall a one-to-one chat message.

* *@param senderID: The sender's user ID. *@param targetID: The receiver's user ID. *@param uID: The unique identifier of the message, returned by the SDK after a successful message send. *@param sentTime: The timestamp when the message was sent, returned by the SDK after a successful message send. * @param int isAdmin * @param int isDelete * @param bool disablePush *@return error

func (*RongCloud) PrivateSend

func (rc *RongCloud) PrivateSend(senderID string, targetID []string, objectName string, msg rcMsg,
	pushContent, pushData string, count, verifyBlacklist, isPersisted, isIncludeSender, contentAvailable int,
	options ...MsgOption) error

PrivateSend Sends a one-to-one chat message (a single user can send a message to multiple users, with a maximum message size of 128k. The maximum number of messages that can be sent per minute is 6000, and the maximum number of users that can be sent to in a single request is 1000. For example, sending to 1000 users counts as 1000 messages.)

*@param senderID: The sender's user ID. *@param targetID: The recipient user ID. This allows sending messages to multiple users, with a maximum of 1000 users per request. *@param objectName: The type of message being sent. *@param msg: Message content. *@param pushContent: Defines the displayed push notification content.If the objectName is a built-in message type of RongCloud, the user will definitely receive a push notification after sending.For custom messages, pushContent is the displayed push notification content of the custom message.If not provided, the user will not receive a push notification. *@param pushData: For iOS platforms, this is the additional payload attached to the push notification. For Android clients, the corresponding field name is pushData. *@param count: For iOS platforms, this controls the display count of unread messages in push notifications.It is only effective when toUserId is a single user ID. *@param verifyBlacklist: Whether to filter the sender's blocklist. 0 means no filtering, 1 means filtering. Default is 0 (no filtering). *@param isPersisted: When the current version has a new custom message and the older version does not, whether the older version client should store the message after receiving it. 0 means no storage, 1 means storage.Default is 1 (store the message). *@param isIncludeSender: Whether the sending user should receive the message.0 means no reception, 1 means reception.Default is 0 (no reception). *@param contentAvailable: For iOS platforms, this enables silent push notifications when the SDK is in the background suspended state.This is a push notification method introduced after iOS7.It allows the app to run a piece of code in the background immediately after receiving the notification.1 means enabled, 0 means disabled.Default is 0. *@param options: Other extended parameters needed for sending messages. * *@return error

func (*RongCloud) PrivateSendTemplate

func (rc *RongCloud) PrivateSendTemplate(senderID, objectName string, template TXTMsg, content []TemplateMsgContent,
	options ...MsgOption) error

PrivateSendTemplate Sends different content messages to multiple users

  • @param senderID: The sender's user ID.
  • @param objectName: The type of message to be sent.
  • @param template: The message template.
  • @param content: The data content, including the message content and recipients.
  • @param options: Additional extended parameters required for sending the message. *
  • @return error

func (*RongCloud) PrivateStatusSend added in v3.2.6

func (rc *RongCloud) PrivateStatusSend(senderID string, targetID []string, objectName string, msg rcMsg,
	verifyBlacklist int, isIncludeSender int, options ...MsgOption) error

Send private status message senderID: The sender's user ID. targetID: The recipient user ID. Supports sending messages to multiple users, with a maximum of 1000 users per request. objectName: The message type. msg: The content of the message to be sent. verifyBlacklist: Whether to filter the sender's blocklist. 0 means no filtering, 1 means filtering. Default is 0 (no filtering). isIncludeSender: Whether the sender should receive the message. 0 means no, 1 means yes. Default is 0 (no).

func (*RongCloud) PrivateURI

func (rc *RongCloud) PrivateURI(uri string)

PrivateURI sets the API address for private cloud

func (*RongCloud) PushCustom added in v3.2.12

func (rc *RongCloud) PushCustom(p []byte) ([]byte, error)

PushCustom: Broadcast to Users with Push-only Notification /push/custom.json

@param: p: Refer to the parameters passed in the TestRongCloud_PushCustom unit test
@param: platform []string Target operating systems, at least one of iOS or Android must be specified. If messages need to be pushed to both systems, both must be filled.
@param: audience string Push conditions, including: tag, tag_or, packageName, is_to_all.
@param: notification string Push notification content by operating system type. If both iOS and Android are set in platform but only iOS content is set in notification, the Android push content will default to the initial alert setting. Refer to the notification structure for details.
Request follows the PushCustomData struct:
You can construct the above as a map or struct for JSON serialization before calling PushCustom.
Response: Returns a byte array
Documentation: https://doc.rongcloud.cn/imserver/server/v1/push-plus#push_custom

func (*RongCloud) PushCustomObj added in v3.2.13

func (rc *RongCloud) PushCustomObj(data PushCustomData) (PushCustomObj, error)

PushCustomObj : Push-only Notification for all users /push/custom.json *

@param: p:Refer to the parameters passed in the TestRongCloud_PushCustom unit test
@param: platform []string Target operating systems, at least one of iOS or Android must be specified. If you need to send push notifications to both systems, all must be filled in.
@param: audience  string Push conditions, including: tag, tag_or, packageName, is_to_all.
@param: notification string Push notification content by operating system type. If both iOS and Android are set in the platform, but only iOS push content is set in the notification, the Android push content will be the initial alert setting. For details, refer to the notification structure description.

Can be constructed as the above map or struct and serialized into JSON before calling PushCustom response: Return structure Documentation: https://doc.rongcloud.cn/imserver/server/v1/push-plus#push_custom *//

func (*RongCloud) PushCustomResObj added in v3.2.12

func (rc *RongCloud) PushCustomResObj(p []byte) (PushCustomObj, error)

PushCustomResObj: Broadcast to Users with Push-only Notification /push/custom.json

@param: p: Refer to the parameters passed in the TestRongCloud_PushCustom unit test
@param: platform []string Target operating systems, at least one of iOS or Android must be specified. If messages need to be pushed to both systems, both must be filled.
@param: audience string Push conditions, including: tag, tag_or, packageName, is_to_all.
@param: notification string Push notification content by operating system type. If both iOS and Android are set in platform but only iOS content is set in notification, the Android push content will default to the initial alert setting. Refer to the notification structure for details.
You can construct the above as a map or struct for JSON serialization before calling PushCustom.
Request follows the PushCustomData struct:
Response: Returns the struct
Documentation: https://doc.rongcloud.cn/imserver/server/v1/push-plus#push_custom

func (*RongCloud) PushSend

func (rc *RongCloud) PushSend(sender Sender) (PushResult, error)

PushSend This method has the same sending mechanism as the /message/broadcast broadcast message method, but allows for more sending conditions. This feature is free to use in the development environment. In the production environment, you need to enable the IM Enterprise Plan in the advanced feature settings of the developer console and then enable it in the "Broadcast Messages and Push Notifications" section before you can use it. The combined frequency of push notifications and broadcast messages is limited to 2 times per hour and 3 times per day. If you need to adjust the sending frequency, please contact us.

*@param Push: The push notification body. * *@return PushResult, error

func (*RongCloud) PushUser added in v3.2.8

func (rc *RongCloud) PushUser(notification *PushNotification, users ...string) error

PushUser Sends a Push-only Notification to specified users in the app. A Push-only Notification will be delivered to the user regardless of whether they are using the app. The notification will only appear in the notification bar and will not carry message content. After logging into the app, the user will not see this content in the chat UI, and it will not be stored in the local database.

func (*RongCloud) QueryMessageExpansion added in v3.2.8

func (rc *RongCloud) QueryMessageExpansion(msgUID string, page int) ([]MessageExpansionItem, error)

QueryMessageExpansion Retrieves message extension information Retrieves the specified message extension information based on the Message UID

func (*RongCloud) QueryWhiteList

func (rc *RongCloud) QueryWhiteList(userId string) (WhiteList, error)

*

  • @name: QueryWhiteList
  • @test:
  • @msg: Get the allowlist of a user (limit: 100 times per second)
  • @param string userId
  • @return: WhiteList error

func (*RongCloud) RemoveWhiteList

func (rc *RongCloud) RemoveWhiteList(userId string, whiteList []string) error

*

  • @name: RemoveWhiteList
  • @test:
  • @msg: Remove users from the allowlist (limit: 100 times per second)
  • @param string userId
  • @param []string whiteList
  • @return: error

func (*RongCloud) SensitiveAdd

func (rc *RongCloud) SensitiveAdd(keyword, replace string, sensitiveType int) error

SensitiveAdd Add a sensitive word

*@param keyword: Sensitive word, max length 32 characters, format: Chinese characters, numbers, letters *@param replace: Replacement for sensitive word, max length 32 characters, can be empty for blocking *@param sensitiveType: 0: Replace sensitive word, 1: Block sensitive word * *@return error

func (*RongCloud) SensitiveGetList

func (rc *RongCloud) SensitiveGetList() (ListWordFilterResult, error)

SensitiveGetList Method to query the sensitive word list

*@return ListWordFilterResult error

func (*RongCloud) SensitiveRemove

func (rc *RongCloud) SensitiveRemove(keywords []string) error

SensitiveRemove Method to remove a sensitive word (Removes a specific sensitive word from the sensitive word list.)

*@param keywords: You can delete up to 50 sensitive words at a time, and the changes will take effect after 2 hours. * *@return error

func (*RongCloud) SetHttpTransport added in v3.2.0

func (rc *RongCloud) SetHttpTransport(httpTransport http.RoundTripper)

Customizes HTTP parameters

func (*RongCloud) SetMessageExpansion added in v3.2.8

func (rc *RongCloud) SetMessageExpansion(msgUID, userId, conversationType, targetId string, extra map[string]string, isSyncSender int) error

SetMessageExpansion Sets message extension When sending a message, if expansion is set to true, you can set extended information for this message. Up to 100 custom attributes can be set at a time, with a maximum of 300 in total.

func (*RongCloud) SystemBroadcast

func (rc *RongCloud) SystemBroadcast(senderID, objectName string, msg rcMsg, options ...MsgOption) error

SystemBroadcast Sends a message to all users in the application. It can be sent up to 2 times per hour and 3 times per day. (Sends a message to a group as a user, with a maximum message size of 128k. A maximum of 20 messages can be sent per second.)

*@param senderID: The sender's user ID. *@param objectName: The message type. *@param msg: The message content to be sent. * *@return error

func (*RongCloud) SystemRecall added in v3.2.6

func (rc *RongCloud) SystemRecall(userId string, targetId string, messageId string, sentTime int,
	options ...MsgOption) error

*

  • @name: SystemRecall
  • @test:
  • @msg: Recall a message - System Conversation
  • @param string userId
  • @param string targetId
  • @param string messageId
  • @param int sentTime
  • @param int isAdmin
  • @param int isDelete
  • @param bool disablePush
  • @return: error

func (*RongCloud) SystemSend

func (rc *RongCloud) SystemSend(senderID string, targetID []string, objectName string, msg rcMsg,
	pushContent, pushData string, count, isPersisted int, options ...MsgOption) error

SystemSend sends a system message from one user to one or multiple users. The maximum size of a single message is 128k, and the conversation type is SYSTEM.

*@param senderID: The sender's user ID. *@param targetID: The recipient user ID(s), with a maximum of 100 users. *@param objectName: The type of message being sent. *@param msg: The message content. *@param pushContent: Defines the displayed push notification content. If the objectName is a RongCloud built-in message type, the user will always receive a push notification. If it's a custom message, pushContent defines the push notification content to be displayed. If not provided, the user will not receive a push notification. *@param pushData: For iOS platforms, this is the additional data attached to the push notification payload. For Android clients, the corresponding field name is pushData. *@param count: For iOS platforms, this controls the number of unread messages displayed in the push notification. It is only effective when toUserId is a single user ID. *@param isPersisted: When a new version introduces a custom message that older versions do not support, this parameter determines whether the older client will store the message. 0 means not stored, 1 means stored. Default is 1 (store the message). *@param options: Additional extended parameters required for sending the message.

* *@return error

func (*RongCloud) SystemSendTemplate

func (rc *RongCloud) SystemSendTemplate(senderID, objectName string, template TXTMsg, content []TemplateMsgContent,
	options ...MsgOption) error

SystemSendTemplate Sends a system message from one user to one or more users. The maximum size of a single message is 128k, and the conversation type is SYSTEM.

*@param senderID: The sender's user ID. *@param objectName: The type of message to be sent. *@param template: The message template. *@param content: The data content, including the message content and recipients. * *@return error

func (*RongCloud) TagBatchSet

func (rc *RongCloud) TagBatchSet(tagBatch TagBatch) error

TagBatchSet Adds tags to users in batch for the application. If a user already has tags, adding new tags will overwrite the previous ones.

*@param t : The TagBatch struct. * *@return error

func (*RongCloud) TagGet

func (rc *RongCloud) TagGet(userIds []string) (TagResult, error)

TagGet Queries all tags for users, supporting batch queries with a maximum of 50 users per query.

*@param userIds: User IDs. * *@return error

func (*RongCloud) TagSet

func (rc *RongCloud) TagSet(tag Tag) error

TagSet Adds tags to a user in the App. If a user already has tags, adding new tags will overwrite the previous tag content.

* @param tag: The Tag struct for the tag. * * @return error

func (*RongCloud) UGChannelCreate added in v3.2.8

func (rc *RongCloud) UGChannelCreate(groupId, channelId string) (err error, requestId string)

Create a group channel

func (*RongCloud) UGChannelDelete added in v3.2.8

func (rc *RongCloud) UGChannelDelete(groupId, channelId string) (err error, requestId string)

Delete a group channel

func (*RongCloud) UGChannelPrivateUserAdd added in v3.2.12

func (rc *RongCloud) UGChannelPrivateUserAdd(groupId, busChannel, userIds string) ([]byte, error)

UGChannelPrivateUserAdd: Add users to the private channel allowlist /ultragroup/channel/private/users/add.json

groupId=ug_m_gid_lw_1&busChannel=channel001&userIds=a%2Cb%2Cc

func (*RongCloud) UGChannelPrivateUserAddResObj added in v3.2.12

func (rc *RongCloud) UGChannelPrivateUserAddResObj(groupId, busChannel, userIds string) (UGChannelPrivateUserAddObj, error)

UGChannelPrivateUserAddResObj : Add users to the private channel allowlist /ultragroup/channel/private/users/add.json

groupId=ug_m_gid_lw_1&busChannel=channel001&userIds=a%2Cb%2Cc

response: UGChannelPrivateUserAddObj

func (*RongCloud) UGChannelPrivateUserDel added in v3.2.12

func (rc *RongCloud) UGChannelPrivateUserDel(groupId, busChannel, userIds string) ([]byte, error)

UGChannelPrivateUserDel : Remove users from the private channel allowlist /ultragroup/channel/private/users/del.json

groupId=ug_m_gid_lw_1&busChannel=channel001&userIds=a%2Cb%2Cc
response : byte array

func (*RongCloud) UGChannelPrivateUserDelResObj added in v3.2.12

func (rc *RongCloud) UGChannelPrivateUserDelResObj(groupId, busChannel, userIds string) (UGChannelPrivateUserDelObj, error)

UGChannelPrivateUserDelResObj : Delete private channel allowlist users /ultragroup/channel/private/users/del.json

groupId=ug_m_gid_lw_1&busChannel=channel001&userIds=a%2Cb%2Cc
response: UGChannelPrivateUserDelObj

func (*RongCloud) UGChannelPrivateUserGet added in v3.2.12

func (rc *RongCloud) UGChannelPrivateUserGet(groupId, busChannel, page, pageSize string) ([]byte, error)

UGChannelPrivateUserGet : Query private channel allowlist users /ultragroup/channel/private/users/get.json

groupId=ug_m_gid_lw_1&busChannel=channel001&page=1&pageSize=1000
response: byte array

func (*RongCloud) UGChannelPrivateUserGetResObj added in v3.2.12

func (rc *RongCloud) UGChannelPrivateUserGetResObj(groupId, busChannel, page, pageSize string) (UGChannelPrivateUserGetObj, error)

UGChannelPrivateUserGetResObj : Query the allowlist users of a private channel /ultragroup/channel/private/users/get.json

groupId=ug_m_gid_lw_1&busChannel=channel001&page=1&pageSize=1000
response: UGChannelPrivateUserGetObj

func (*RongCloud) UGChannelQuery added in v3.2.8

func (rc *RongCloud) UGChannelQuery(groupId string, page, size int) (channels []UGChannelInfo, err error, requestId string)

Query group channel list

func (*RongCloud) UGChannelUserGroupBind added in v3.2.19

func (rc *RongCloud) UGChannelUserGroupBind(groupId, busChannel string, userGroupIds []string) (err error)

UGChannelUserGroupBind Bind user groups to a channel in bulk

func (*RongCloud) UGChannelUserGroupQuery added in v3.2.19

func (rc *RongCloud) UGChannelUserGroupQuery(groupId, busChannel string, page, pageSize int) (userGroupIds []string, err error)

UGChannelUserGroupQuery Query the list of user groups bound to the channel

func (*RongCloud) UGChannelUserGroupUnbind added in v3.2.19

func (rc *RongCloud) UGChannelUserGroupUnbind(groupId, busChannel string, userGroupIds []string) (err error)

UGChannelUserGroupUnbind Unbind user groups from a channel in bulk

func (*RongCloud) UGGroupChannelChange added in v3.2.12

func (rc *RongCloud) UGGroupChannelChange(groupId, busChannel, t string) ([]byte, error)

UGGroupChannelChange : /ultragroup/channel/type/change Set public/private channel type (switch) *

@param: groupId
@param: busChannel
@param: type

*//

func (*RongCloud) UGGroupChannelChangeResObj added in v3.2.12

func (rc *RongCloud) UGGroupChannelChangeResObj(groupId, busChannel, t string) (UGGroupChannelChangeObj, error)

UGGroupChannelChangeResObj : /ultragroup/channel/type/change Set the public/private channel type (switch) *

@param: groupId
@param: busChannel
@param: type

*//

func (*RongCloud) UGGroupChannelCreate added in v3.2.12

func (rc *RongCloud) UGGroupChannelCreate(groupId, busChannel, t string) ([]byte, error)

UGGroupChannelCreate : Create a channel - supports setting the channel type /ultragroup/channel/create.json * groupId=ug_m_gid_lw_1&busChannel=channel001&type=0

response: byte array *//

func (*RongCloud) UGGroupChannelGet added in v3.2.12

func (rc *RongCloud) UGGroupChannelGet(groupId string, page, limit int) ([]byte, error)

UGGroupChannelGet: Channel query - Returns results with channel type /ultragroup/channel/get.json

groupId=ug_m_gid_lw_1&page=1&limit=20
response: Returns byte array

func (*RongCloud) UGGroupCreate added in v3.2.8

func (rc *RongCloud) UGGroupCreate(userId, groupId, groupName string) (err error, requestId string)

Create a group

func (*RongCloud) UGGroupDismiss added in v3.2.8

func (rc *RongCloud) UGGroupDismiss(groupId string) (err error, requestId string)

Dismiss an ultra group

func (*RongCloud) UGGroupJoin added in v3.2.8

func (rc *RongCloud) UGGroupJoin(userId, groupId string) (err error, requestId string)

Join an ultra group

func (*RongCloud) UGGroupMuteMembersAdd added in v3.2.8

func (rc *RongCloud) UGGroupMuteMembersAdd(groupId string, userIds []string) (err error, requestId string)

Add muted members to the group

func (*RongCloud) UGGroupMuteMembersGetList added in v3.2.8

func (rc *RongCloud) UGGroupMuteMembersGetList(groupId string) (users []UGUserInfo, err error, requestId string)

Get muted members of the ultra group

func (*RongCloud) UGGroupMuteMembersRemove added in v3.2.8

func (rc *RongCloud) UGGroupMuteMembersRemove(groupId string, userIds []string) (err error, requestId string)

Remove muted members from the group

func (*RongCloud) UGGroupMuted added in v3.2.8

func (rc *RongCloud) UGGroupMuted(groupId string, status bool) (err error, requestId string)

Mute all members of the ultra group

func (*RongCloud) UGGroupMutedQuery added in v3.2.8

func (rc *RongCloud) UGGroupMutedQuery(groupId string) (status bool, err error, requestId string)

Query the mute status of all members in an ultra group

func (*RongCloud) UGGroupMutedWhitelistAdd added in v3.2.8

func (rc *RongCloud) UGGroupMutedWhitelistAdd(groupId string, userIds []string) (err error, requestId string)

Add users to the mute exceptions list

func (*RongCloud) UGGroupMutedWhitelistQuery added in v3.2.8

func (rc *RongCloud) UGGroupMutedWhitelistQuery(groupId string) (users []UGUserInfo, err error, requestId string)

Query the allowlist for muted users in an ultra group

func (*RongCloud) UGGroupMutedWhitelistRemove added in v3.2.8

func (rc *RongCloud) UGGroupMutedWhitelistRemove(groupId string, userIds []string) (err error, requestId string)

Remove users from the mute exceptions list

func (*RongCloud) UGGroupQuit added in v3.2.8

func (rc *RongCloud) UGGroupQuit(userId, groupId string) (err error, requestId string)

Quit an ultra group

func (*RongCloud) UGGroupSend added in v3.2.8

func (rc *RongCloud) UGGroupSend(msg UGMessage) (err error, requestId string)

Send a message in an ultra group

func (*RongCloud) UGGroupUpdate added in v3.2.8

func (rc *RongCloud) UGGroupUpdate(groupId, groupName string) (err error, requestId string)

Refresh group information

func (*RongCloud) UGHisMsgIdQuery added in v3.2.17

func (rc *RongCloud) UGHisMsgIdQuery(groupId, busChannel, msgUID, prevNum, lastNum string) (UGHisMsgIdQueryResp, error)

UGHisMsgIdQuery API to retrieve historical messages around a specific message ID /ultragroup/hismsg/msgid/query.json param: groupId Required String The ID of the ultra group param: busChannel Required String The ID of the channel param: msgUID Required string The message ID to query, retrieves 10 messages before and after the specified message ID param: prevNum Optional string Default is 10 (maximum 50) messages to retrieve before the message ID. If 0 is passed, no messages before the message ID are retrieved param: lastNum Optional string Default is 10 (maximum 50) messages to retrieve after the message ID. If 0 is passed, no messages after the message ID are retrieved

func (*RongCloud) UGHistoryQuery added in v3.2.16

func (rc *RongCloud) UGHistoryQuery(groupId, busChannel string, startTime, endTime int64, fromUserId string, pageSize int) (UGHisMsgQueryResp, error)

UGHistoryQuery • API: /ultragroup/hismsg/query.json • Purpose: Query ultra group historical messages • Rate Limit: 100 requests per minute at the appKey level param: groupId Required String Ultra group ID param: busChannel Required String Channel ID param: startTime Required int64 Query start timestamp param: endTime Required int64 Query end timestamp. The maximum time span between start and end time is 14 days. param: fromUserId Optional String Sender ID of the message. If provided, only messages sent by this user will be queried; otherwise, all historical messages in the group will be queried. param: pageSize Optional int Default is 20, maximum is 100. UGHisMsgQueryResp: Returned data result set startTime<resultList<=endTime, and resultList data is sorted in ascending order by message timestamp.

func (*RongCloud) UGMemberExists added in v3.2.8

func (rc *RongCloud) UGMemberExists(groupId, userId string) (bool, error)

UGMemberExists Checks if a user exists in an ultra group

func (*RongCloud) UGMessageExpansionDelete added in v3.2.8

func (rc *RongCloud) UGMessageExpansionDelete(groupId, userId, msgUID, busChannel string, keys ...string) error

UGMessageExpansionDelete Deletes message expansion

func (*RongCloud) UGMessageExpansionQuery added in v3.2.8

func (rc *RongCloud) UGMessageExpansionQuery(groupId, msgUID, busChannel string) ([]UGMessageExpansionItem, error)

UGMessageExpansionQuery Query message expansion information

func (*RongCloud) UGMessageExpansionSet added in v3.2.8

func (rc *RongCloud) UGMessageExpansionSet(groupId, userId, msgUID, busChannel string, extra map[string]string) error

UGMessageExpansionSet Set message extension

func (*RongCloud) UGMessageGet added in v3.2.11

func (rc *RongCloud) UGMessageGet(groupId string, msgList []UGMessageData, options ...MsgOption) ([]byte, error)

UGMessageGet : Retrieve Ultra Group Messages by Message ID /ultragroup/msg/get * @param groupId: Ultra Group ID @param msgList: Message parameter array, each element is UGMessageData response: Returns byte array */

func (*RongCloud) UGMessageGetObj added in v3.2.12

func (rc *RongCloud) UGMessageGetObj(groupId string, msgList []UGMessageData, options ...MsgOption) (UGMessageGetData, error)

UGMessageGetObj : Batch retrieve ultra group messages by message ID /ultragroup/msg/get * @param groupId: Ultra group ID @param msgList: Message parameter array, each element is UGMessageData response: Response structure */

func (*RongCloud) UGMessageModify added in v3.2.11

func (rc *RongCloud) UGMessageModify(groupId, fromUserId, msgUID, content string, options ...UgMessageExtension) ([]byte, error)

UGMessageModify : Ultra Group Message Modification /ultragroup/msg/modify.json * @param groupId: Ultra group ID @param fromUserId: Message sender @param msgUID: Unique identifier of the message @param content: Message content, up to 128k @param busChannel: Channel ID, supports alphanumeric combinations, up to 20 characters @param msgRandom: Unique request identifier, ensures idempotency within one minute */

func (*RongCloud) UGMessagePublish added in v3.2.8

func (rc *RongCloud) UGMessagePublish(fromUserId, objectName, content, pushContent, pushData, isPersisted, isCounted, isMentioned, contentAvailable, busChannel, extraContent string, expansion, unreadCountFlag bool, pushExt *PushExt, toGroupIds ...string) error

UGMessagePublish Sends a message to an ultra group Documentation: https://doc.rongcloud.cn/imserver/server/v1/message/msgsend/ultragroup

func (*RongCloud) UGMessageRecall added in v3.2.8

func (rc *RongCloud) UGMessageRecall(userId, targetId, messageId string, sentTime int, options ...MsgOption) error

UGMessageRecall Ultra group message recall

func (*RongCloud) UGNotDisturbGet added in v3.2.8

func (rc *RongCloud) UGNotDisturbGet(groupId, busChannel string) (*UGNotDisturbGetResponses, error)

func (*RongCloud) UGNotDisturbSet added in v3.2.8

func (rc *RongCloud) UGNotDisturbSet(groupId string, unPushLevel int, busChannel string) error

UGNotDisturbSet Sets the default Do Not Disturb level for a group/channel

func (*RongCloud) UGQueryGroupUsers added in v3.2.8

func (rc *RongCloud) UGQueryGroupUsers(groupId string, page, size int) (users []UGUserInfo, err error, requestId string)

Query group members (P1)

func (*RongCloud) UGQueryUserGroups added in v3.2.8

func (rc *RongCloud) UGQueryUserGroups(userId string, page, size int) (groups []UGGroupInfo, err error, requestId string)

Query groups that a user belongs to (P1)

func (*RongCloud) UGUserChannelQuery added in v3.2.19

func (rc *RongCloud) UGUserChannelQuery(groupId, userId string, page, pageSize int) (busChannelIds []string, err error)

UGUserChannelQuery Query the allowlist of channels the user belongs to

func (*RongCloud) UGUserGroupAdd added in v3.2.19

func (rc *RongCloud) UGUserGroupAdd(groupId string, userGroups []UGUserGroupInfo) (err error)

UGUserGroupAdd Batch create user groups

func (*RongCloud) UGUserGroupChannelQuery added in v3.2.19

func (rc *RongCloud) UGUserGroupChannelQuery(groupId, userGroupId string, page, pageSize int) (busChannelIds []string, err error)

UGUserGroupChannelQuery Query the list of channels bound to the user group

func (*RongCloud) UGUserGroupDelete added in v3.2.19

func (rc *RongCloud) UGUserGroupDelete(groupId string, userGroupIds []string) (err error)

UGUserGroupDelete Batch delete user groups

func (*RongCloud) UGUserGroupQuery added in v3.2.19

func (rc *RongCloud) UGUserGroupQuery(groupId string, page, pageSize int) (userGroups []UGUserGroupInfo, err error)

UGUserGroupQuery Paginates and queries user group information under an ultra group

func (*RongCloud) UGUserGroupUserAdd added in v3.2.19

func (rc *RongCloud) UGUserGroupUserAdd(groupId, userGroupId string, userIds []string) (err error)

UGUserGroupUserAdd Adds users to a user group in bulk

func (*RongCloud) UGUserGroupUserDelete added in v3.2.19

func (rc *RongCloud) UGUserGroupUserDelete(groupId, userGroupId string, userIds []string) (err error)

UGUserGroupUserDelete Batch remove users from a user group

func (*RongCloud) UGUserUserGroupQuery added in v3.2.19

func (rc *RongCloud) UGUserUserGroupQuery(groupId, userId string, page, pageSize int) (userGroupIds []string, err error)

UGUserUserGroupQuery Query the list of user groups a user belongs to in an ultra group

func (*RongCloud) UltraGroupBannedWhiteListAdd added in v3.2.8

func (rc *RongCloud) UltraGroupBannedWhiteListAdd(groupId, busChannel string, userIds ...string) error

UltraGroupBannedWhiteListAdd Add users to the mute exceptions list

func (*RongCloud) UltraGroupBannedWhiteListDel added in v3.2.8

func (rc *RongCloud) UltraGroupBannedWhiteListDel(groupId, busChannel string, userIds ...string) error

UltraGroupBannedWhiteListDel Remove users from the mute exceptions list

func (*RongCloud) UltraGroupBannedWhiteListGet added in v3.2.8

func (rc *RongCloud) UltraGroupBannedWhiteListGet(groupId, busChannel string, page, pageSize int) ([]UltraGroupBannedWhiteListGetResponseItem, error)

UltraGroupBannedWhiteListGet Get the Mute Exceptions list

func (*RongCloud) UltraGroupChannelCreate added in v3.2.8

func (rc *RongCloud) UltraGroupChannelCreate(groupId, busChannel string) error

UltraGroupChannelCreate Create a channel

func (*RongCloud) UltraGroupChannelDel added in v3.2.8

func (rc *RongCloud) UltraGroupChannelDel(groupId, busChannel string) error

UltraGroupChannelDel Deletes a channel

func (*RongCloud) UltraGroupChannelGet added in v3.2.8

func (rc *RongCloud) UltraGroupChannelGet(groupId string, page, limit int) ([]UltraGroupChannelGetResponseItem, error)

UltraGroupChannelGet Query the list of channels response:[]UltraGroupChannelGetResponseItem

func (*RongCloud) UltraGroupCreate added in v3.2.8

func (rc *RongCloud) UltraGroupCreate(userId, groupId, groupName string) error

UltraGroupCreate Creates an ultra group

func (*RongCloud) UltraGroupDis added in v3.2.8

func (rc *RongCloud) UltraGroupDis(groupId string) error

UltraGroupDis Dissolve an ultra group

func (*RongCloud) UltraGroupGlobalBannedGet added in v3.2.8

func (rc *RongCloud) UltraGroupGlobalBannedGet(groupId, busChannel string) (bool, error)

UltraGroupGlobalBannedGet Query the mute status of an ultra group

func (*RongCloud) UltraGroupGlobalBannedSet added in v3.2.8

func (rc *RongCloud) UltraGroupGlobalBannedSet(groupId, busChannel string, status bool) error

UltraGroupGlobalBannedSet Set the mute status for an ultra group

func (*RongCloud) UltraGroupJoin added in v3.2.8

func (rc *RongCloud) UltraGroupJoin(userId, groupId string) error

UltraGroupJoin Join an ultra group

func (*RongCloud) UltraGroupQuit added in v3.2.8

func (rc *RongCloud) UltraGroupQuit(userId, groupId string) error

UltraGroupQuit Quit an ultra group

func (*RongCloud) UltraGroupRefresh added in v3.2.8

func (rc *RongCloud) UltraGroupRefresh(groupId, groupName string) error

UltraGroupRefresh Refreshes ultra group information

func (*RongCloud) UltraGroupUserBannedAdd added in v3.2.8

func (rc *RongCloud) UltraGroupUserBannedAdd(groupId, busChannel string, userIds ...string) error

UltraGroupUserBannedAdd Add banned members to the ultra group

func (*RongCloud) UltraGroupUserBannedDel added in v3.2.8

func (rc *RongCloud) UltraGroupUserBannedDel(groupId, busChannel string, userIds ...string) error

UltraGroupUserBannedDel Remove banned users from the ultra group

func (*RongCloud) UltraGroupUserBannedGet added in v3.2.8

func (rc *RongCloud) UltraGroupUserBannedGet(groupId, busChannel string, page, pageSize int) ([]UltraGroupUserBannedResponseItem, error)

UltraGroupUserBannedGet Get banned users in an ultra group

func (*RongCloud) UserBlockPushPeriodDelete added in v3.2.13

func (rc *RongCloud) UserBlockPushPeriodDelete(userId string) error

UserBlockPushPeriodDelete Delete user's Do Not Disturb period /user/blockPushPeriod/delete.json * @param: userId User ID, required

*//

func (*RongCloud) UserBlockPushPeriodGet added in v3.2.13

func (rc *RongCloud) UserBlockPushPeriodGet(userId string) (PushPeriodGet, error)

UserBlockPushPeriodGet UserBlockPushPeriodGet: Get user's Do Not Disturb period /user/blockPushPeriod/get.json * @param: userId User ID, required

response : PushPeriodGet

*//

func (*RongCloud) UserBlockPushPeriodSet added in v3.2.13

func (rc *RongCloud) UserBlockPushPeriodSet(userId, startTime, period, level string) error

UserBlockPushPeriodSet : Set user's Do Not Disturb period /user/blockPushPeriod/set.json *

@param :userId User ID (required)
@param :startTime Start time (in seconds) (required)
@param :period Duration (in minutes) (required)
@param :level Do Not Disturb Level (default is 1, optional)
form data

*//

func (*RongCloud) UserChatFbQueryList added in v3.2.11

func (rc *RongCloud) UserChatFbQueryList(num, offset int, t string) ([]byte, error)

UserChatFbQueryList * /user/chat/fb/querylist Query the list of muted users @param: num : Number of rows to fetch, defaults to 100, maximum supported is 200 @param: offset : Starting position for the query, defaults to 0. @param: t : Conversation type, currently supports one-to-one chat PERSON. response: Returns a byte array https://doc.rongcloud.cn/imserver/server/v1/user/ban */

func (*RongCloud) UserChatFbQueryListResObj added in v3.2.12

func (rc *RongCloud) UserChatFbQueryListResObj(num, offset int, t string) (UserChatFbQueryListObj, error)

UserChatFbQueryListResObj * /user/chat/fb/querylist Query the list of muted users @param: num: Number of rows to fetch, default is 100, maximum supported is 200 @param: offset: Starting position for the query, default is 0 @param: t: Conversation type, currently supports one-to-one chat PERSON response: UserChatFbQueryListObj Documentation: https://doc.rongcloud.cn/imserver/server/v1/user/ban */

func (*RongCloud) UserChatFbSet added in v3.2.11

func (rc *RongCloud) UserChatFbSet(userId string, state int, t string) error

UserChatFbSet * Mute a user in one-to-one chat @param: userId : User ID to be muted, supports batch setting, maximum of 1000 users @param: state : Mute state, 0 to unmute, 1 to mute @param: type : Conversation type, currently supports one-to-one chat PERSON */

func (*RongCloud) UserDeactivate added in v3.2.22

func (rc *RongCloud) UserDeactivate(userIds []string) (*UserDeactivateResponse, error)

UserDeactivate Deactivates users @param userIds []string User IDs to be deactivated, up to 100 at a time @return string, error official doc https://doc.rongcloud.cn/imserver/server/v1/user/deactivate After initiating deactivation, the server will notify the deactivation result via callback within 15 minutes. https://doc.rongcloud.cn/imserver/server/v1/user/callback-deactivation

func (*RongCloud) UserDeactivateQuery added in v3.2.22

func (rc *RongCloud) UserDeactivateQuery(pageNo, pageSize int) (*UserDeactivateQueryResponse, error)

UserDeactivateQuery Queries deactivated users @param pageNo Current page number for paginated retrieval of deactivated user list, default is 1, minimum is 1. @param pageSize Number of rows per page for paginated retrieval of deactivated user list, default is 50, minimum is 1, maximum is 50. @return string, error official doc https://doc.rongcloud.cn/imserver/server/v1/user/query-deactivated-list

func (*RongCloud) UserProfilBatchQuery added in v3.2.24

func (rc *RongCloud) UserProfilBatchQuery(userId string) (*UserProfileQueryResponse, error)

UserProfilBatchQuery /user/profile/batch/query.json Batch query user profiles *

@param: userId: Required. Specifies the user ID to be queried.
response: UserProfileQueryResponse, err

*//

func (*RongCloud) UserProfilQuery added in v3.2.24

func (rc *RongCloud) UserProfilQuery(page int, size int, order int) (*UserProfileQueryResponse, error)
@param: size: Optional. Specifies the number of items per page.
@param: order: Optional. Defines the sorting mechanism based on registration time. Default is ascending order. 0 for ascending, 1 for descending.
response: UserProfileQueryResponse, err

*//

func (*RongCloud) UserProfileClean added in v3.2.24

func (rc *RongCloud) UserProfileClean(userId string) error

UserProfileClean /user/profile/clean.json Clear User Profile Hosting *

@param: userId: Required The user ID to be set
response: err

*//

func (*RongCloud) UserProfileSet added in v3.2.24

func (rc *RongCloud) UserProfileSet(userId string, userProfile string, userExtProfile string) error

UserProfileSet /user/profile/set.json User profile settings *

@param: userId: Required The user ID to be set
@param: userProfile: Optional Basic user information
@param: userExtProfile: Optional Extended user information
response: err

*//

func (*RongCloud) UserReactivate added in v3.2.22

func (rc *RongCloud) UserReactivate(userIds []string) (*UserReactivateResponse, error)

UserReactivate Reactivate deactivated users @param userIds []string User IDs to reactivate, with a maximum of 100 user IDs per request. @return string, error Official documentation: https://doc.rongcloud.cn/imserver/server/v1/user/reactivate To get the reactivation result, use the (https://doc.rongcloud.cn/imserver/server/v1/user/callback-deactivation) interface. Repeated calls to this interface will not result in errors.

func (*RongCloud) UserRegister

func (rc *RongCloud) UserRegister(userID, name, portraitURI string) (User, error)

UserRegister Registers a user and generates a unique Token for the user in RongCloud.

*@param userID: User ID, maximum length of 64 bytes. It is the unique identifier for the user within the App. It must be unique within the same App, and duplicate user IDs will be treated as the same user. *@param name: User name, maximum length of 128 bytes. Used to display the user's name in push notifications. *@param portraitURI: User avatar URI, maximum length of 1024 bytes. Used to display the user's avatar in push notifications. Can be empty. * *@return User, error

func (*RongCloud) UserRemarksDel added in v3.2.11

func (rc *RongCloud) UserRemarksDel(userId, targetId string) error

UserRemarksDel /user/remarks/del.json Delete user-level push remark *

@param: userId :Operator user ID.
@param: targetId: User ID for which the push remark needs to be deleted

*/

func (*RongCloud) UserRemarksGet added in v3.2.11

func (rc *RongCloud) UserRemarksGet(userId string, page, size int) ([]byte, error)

UserRemarksGet /user/remarks/get.json Query user push remark name *

@param: userId : User ID.
@param: page : Page number, defaults to the first page.
@param: size : Number of items per page, defaults to 50 items per page.

response : Byte array Documentation: https://doc.rongcloud.cn/imserver/server/v1/user/get-remark-for-push */

func (*RongCloud) UserRemarksGetResObj added in v3.2.12

func (rc *RongCloud) UserRemarksGetResObj(userId string, page, size int) (UserRemarksGetObj, error)

Documentation: https://doc.rongcloud.cn/imserver/server/v1/user/get-remark-for-push

*/

func (*RongCloud) UserRemarksSet added in v3.2.11

func (rc *RongCloud) UserRemarksSet(userId string, remarks []UserRemark) error

UserRemarksSet /user/remarks/set.json * @param: userId: User ID. @param: remarks: JSON string of the target user push remarks to be set

*/

func (*RongCloud) UserTokenExpire added in v3.2.12

func (rc *RongCloud) UserTokenExpire(userId string, t int64) ([]byte, error)

Documentation: https://doc.rongcloud.cn/imserver/server/v1/user/expire

*//

func (*RongCloud) UserTokenExpireResObj added in v3.2.12

func (rc *RongCloud) UserTokenExpireResObj(userId string, t int64) (UserTokenExpireObj, error)

UserTokenExpireResObj /user/token/expire.json Token expiration *

@param: userId: Required The user ID(s) for which the Token needs to be invalidated. Supports multiple users, up to 20.
@param: time: Required The expiration timestamp in milliseconds. All Tokens obtained before this timestamp will be invalidated. Users already connected with Tokens obtained before this timestamp will not be immediately disconnected but will be unable to reconnect after disconnection.
response: UserTokenExpireObj
Documentation: https://doc.rongcloud.cn/imserver/server/v1/user/expire

*//

func (*RongCloud) UserUpdate

func (rc *RongCloud) UserUpdate(userID, name, portraitURI string) error

UserUpdate Updates user information

*@param userID: User ID, maximum length 64 bytes. It is the unique identifier of the user within the App. It must be ensured that it is not duplicated within the same App. Duplicate user IDs will be treated as the same user. *@param name: User name, maximum length 128 bytes. It is used to display the user's name in push notifications. The user name will take effect within 5 minutes after refreshing. (Optional, refresh if provided, ignore if not provided) *@param portraitURI: User avatar URI, maximum length 1024 bytes. It is used to display the user's avatar in push notifications. (Optional, refresh if provided, ignore if not provided) * *@return error

type Sender

type Sender interface {
	// contains filtered or unexported methods
}

Sender Broadcast push interface

type SensitiveWord

type SensitiveWord struct {
	Type        string `json:"type"`
	Word        string `json:"word"`
	ReplaceWord string `json:"replaceWord"`
}

SensitiveWord Sensitive word

type TXTMsg

type TXTMsg struct {
	Content string      `json:"content"`
	User    MsgUserInfo `json:"user"`
	Extra   string      `json:"extra"`
}

TXTMsg message

func (*TXTMsg) ToString

func (msg *TXTMsg) ToString() (string, error)

ToString TXTMsg

type Tag

type Tag struct {
	UserID string   `json:"userId"` // User ID (required)
	Tags   []string `json:"tags"`   // User tags. A user can have up to 20 tags, each tag cannot exceed 40 bytes, and special characters are not allowed in tags. (required)
}

Tag TagSet parameters

type TagBatch

type TagBatch struct {
	UserIDs []string `json:"userIds"` // User IDs, up to 1000 users per request. (required)
	Tags    []string `json:"tags"`    // User tags. A user can have up to 20 tags, each tag cannot exceed 40 bytes, and special characters are not allowed in tags. (required)
}

TagBatch TagBatchSet parameters

type TagResult

type TagResult struct {
	*CodeResult
	Result map[string][]string `json:"result"` // Array of all tags for the user.
}

TagResult TagGet return value

type TemplateMsgContent

type TemplateMsgContent struct {
	TargetID    string
	Data        map[string]string
	PushContent string
	PushData    string
}

TemplateMsgContent Message template

type UGChannelInfo added in v3.2.8

type UGChannelInfo struct {
	ChannelId  string `json:"channel_id"`
	CreateTime string `json:"create_time"`
}

Ultra group channel information

type UGChannelPrivateUserAddObj added in v3.2.12

type UGChannelPrivateUserAddObj struct {
	Code int `json:"code"`
}

type UGChannelPrivateUserDelObj added in v3.2.12

type UGChannelPrivateUserDelObj struct {
	Code int `json:"code"`
}

type UGChannelPrivateUserGetObj added in v3.2.12

type UGChannelPrivateUserGetObj struct {
	Code  int      `json:"code"`
	Users []string `json:"users"`
}

UGChannelPrivateUserGetObj : The return value of UGChannelPrivateUserGetResObj

type UGGroupChannelChangeObj added in v3.2.12

type UGGroupChannelChangeObj struct {
	Code int `json:"code"`
}

type UGGroupInfo added in v3.2.8

type UGGroupInfo struct {
	GroupId   string `json:"group_id"`
	GroupName string `json:"group_name"`
}

Ultra group group information

type UGHisMsgIdQueryData added in v3.2.17

type UGHisMsgIdQueryData struct {
	GroupId        string `json:"groupId"`
	BusChannel     string `json:"busChannel"`
	FromUserId     string `json:"fromUserId"`
	MsgUID         string `json:"msgUID"`
	MsgTime        int64  `json:"msgTime"`
	ObjectName     string `json:"objectName"`
	ConversionType int    `json:"conversionType"`
	Content        string `json:"content"`
	Expansion      bool   `json:"expansion"`
	ExtraContent   string `json:"extraContent"`
}

type UGHisMsgIdQueryResp added in v3.2.17

type UGHisMsgIdQueryResp struct {
	Code int                   `json:"code"`
	Data []UGHisMsgIdQueryData `json:"data"`
}

type UGHisMsgQueryData added in v3.2.16

type UGHisMsgQueryData struct {
	GroupId        string `json:"groupId"`
	BusChannel     string `json:"busChannel"`
	FromUserId     string `json:"fromUserId"`
	MsgUID         string `json:"msgUID"`
	MsgTime        int64  `json:"msgTime"`
	ObjectName     string `json:"objectName"`
	ConversionType int    `json:"conversionType"`
	Content        string `json:"content"`
	Expansion      bool   `json:"expansion"`
	ExtraContent   string `json:"extraContent"`
}

type UGHisMsgQueryResp added in v3.2.16

type UGHisMsgQueryResp struct {
	Code int                 `json:"code"`
	Data []UGHisMsgQueryData `json:"data"`
}

type UGMessage added in v3.2.8

type UGMessage struct {
	FromUserId          string   `json:"from_user_id"`
	ToGroupIds          []string `json:"to_group_ids"`
	ToUserIds           []string `json:"to_user_ids,omitempty"`
	ObjectName          string   `json:"object_name"`
	Content             string   `json:"content"`
	PushContent         string   `json:"push_content,omitempty"`
	PushData            string   `json:"push_data,omitempty"`
	IncludeSenderEnable bool     `json:"include_sender_enable,omitempty"`
	StoreFlag           bool     `json:"store_flag"`
	MentionedFlag       bool     `json:"mentioned_flag,omitempty"`
	SilencePush         bool     `json:"silence_push,omitempty"`
	PushExt             string   `json:"push_ext,omitempty"`
	BusChannel          string   `json:"bus_channel,omitempty"`
}

Ultra group message structure

type UGMessageData added in v3.2.11

type UGMessageData struct {
	// Unique identifier of the message
	MsgUid string `json:"msgUID"`

	// Channel ID, supports alphanumeric combinations, up to 20 characters
	BusChannel string `json:"busChannel,omitempty"`
}

UGMessageData: Message parameter array in the UGMessageGet method

type UGMessageExpansionItem added in v3.2.8

type UGMessageExpansionItem struct {
	Key       string `json:"key"`
	Value     string `json:"value"`
	Timestamp int64  `json:"timestamp"`
}

type UGMessageGetData added in v3.2.12

type UGMessageGetData struct {
	Code int                    `json:"code"`
	Data []UGMessageGetDataList `json:"data"`
}

type UGMessageGetDataList added in v3.2.12

type UGMessageGetDataList struct {
	FromUserId   string `json:"fromUserId"`
	GroupId      string `json:"groupId"`
	SentTime     uint64 `json:"sentTime"`
	BusChannel   string `json:"busChannel"`
	MsgUid       string `json:"msgUID"`
	ObjectName   string `json:"objectName"`
	Content      string `json:"content"`
	Expansion    bool   `json:"expansion"`
	ExtraContent string `json:"extraContent"`
}

type UGNotDisturbGetResponses added in v3.2.8

type UGNotDisturbGetResponses struct {
	GroupId     string `json:"groupId"`
	BusChannel  string `json:"busChannel"`
	UnPushLevel int    `json:"unpushLevel"`
}

type UGUserGroupInfo added in v3.2.19

type UGUserGroupInfo struct {
	UserGroupId string `json:"userGroupId"`
}

Ultra group user group information

type UGUserInfo added in v3.2.8

type UGUserInfo struct {
	Id        string `json:"id"`
	MutedTime string `json:"time"`
}

Ultra group user information

type UgMessageExtension added in v3.2.11

type UgMessageExtension struct {
	// Channel ID, supports a combination of letters and numbers, up to 20 characters.
	BusChannel string

	// Unique request identifier, ensures idempotency within one minute.
	MsgRandom int64
}

UgMessageExtension : Batch retrieves extended messages for ultra group messages based on message ID, optional.

type UltraGroupBannedWhiteListGetResponseItem added in v3.2.8

type UltraGroupBannedWhiteListGetResponseItem struct {
	Id string `json:"id"`
}

type UltraGroupChannelGetResponseItem added in v3.2.8

type UltraGroupChannelGetResponseItem struct {
	ChannelId  string `json:"channelId"`
	Type       int    `json:"type"`
	CreateTime string `json:"createTime"`
}

type UltraGroupUserBannedResponseItem added in v3.2.8

type UltraGroupUserBannedResponseItem struct {
	Id string `json:"id"`
}

type User

type User struct {
	Token        string `json:"token"`
	UserID       string `json:"userId"`
	BlockEndTime string `json:"blockEndTime,omitempty"`
	Status       string `json:"status,omitempty"`
}

User User information response

type UserChatFbQueryListObj added in v3.2.12

type UserChatFbQueryListObj struct {
	// Response code, 200 indicates success.
	Code int `json:"code"`

	// Total number of muted users.
	Total int `json:"total"`

	// Array of muted users.
	Users []string `json:"users"`
}

UserChatFbQueryListObj: Response object for querying the list of muted users

type UserDeactivateQueryResponse added in v3.2.22

type UserDeactivateQueryResponse struct {
	Code  int      `json:"code"`  // Return code, 200 indicates success
	Users []string `json:"users"` // List of deactivated user IDs
}

type UserDeactivateResponse added in v3.2.22

type UserDeactivateResponse struct {
	Code      int    `json:"code"`
	OperateId string `json:"operateId"` // Operation ID, the unique identifier for the current operation. This parameter is included in the callback request body after enabling the User Deactivation and Activation Status Callback.
}

type UserProfileQueryResponse added in v3.2.24

type UserProfileQueryResponse struct {
	Code         int                   `json:"code"` // Response code, 200 indicates success
	UserProfiles []UserProfileResponse `json:"userList"`
}

type UserProfileResponse added in v3.2.24

type UserProfileResponse struct {
	UserId         string `json:"userId"`
	Version        int    `json:"version"`
	UserProfile    string `json:"userProfile"`
	UserExtProfile string `json:"userExtProfile"`
}

type UserReactivateResponse added in v3.2.22

type UserReactivateResponse struct {
	Code      int    `json:"code"`      // Response code, 200 indicates success. The result of each user ID operation is passed through the User Deactivation and Activation Status Callback.
	OperateId string `json:"operateId"` // Operation ID, the unique identifier for the current operation. This parameter is included in the callback request body after enabling the User Deactivation and Activation Status Callback.
}

type UserRemark added in v3.2.11

type UserRemark struct {
	// Target user ID. A maximum of 100 can be set at a time.
	Id string

	// The remark name displayed when receiving a push from the target user.
	Remark string
}

UserRemark :Parameters received by the UserRemarksSet method

type UserRemarksGetObj added in v3.2.12

type UserRemarksGetObj struct {
	// Return code, 200 indicates success.
	Code int `json:"code"`

	// Total number of user remarks.
	Total int `json:"total"`

	// JSON object array containing user IDs (id) and corresponding remarks (remark). A maximum of 50 user remarks can be returned per request.
	Users []UserRemarksUsers `json:"users"`
}

UserRemarksGetObj : The return value of UserRemarksGetResObj

type UserRemarksUsers added in v3.2.12

type UserRemarksUsers struct {
	// User ID
	Id string `json:"id"`

	// Remark name
	Remark string `json:"remark"`
}

type UserTokenExpireObj added in v3.2.12

type UserTokenExpireObj struct {
	// Return code, 200 indicates success
	Code int `json:"code"`
}

UserTokenExpireObj: Return value definition

type VCMsg

type VCMsg struct {
	Content  string      `json:"content"`
	User     MsgUserInfo `json:"user"`
	Extra    string      `json:"extra"`
	Duration interface{} `json:"duration"`
}

VCMsg Message

func (*VCMsg) ToString

func (msg *VCMsg) ToString() (string, error)

ToString VCMsg

type WhiteList

type WhiteList struct {
	Users []string `json:"users"`
}

WhiteList QueryWhiteList return data

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL