提交工单
咨询集成、功能及报价等问题
Managing the messages is an important session to realize the signaling synchronization in the Live Audio Room. This document describes how to manage messages.
To send bullet screen messages in the room, call the sendTextMessage
method.
RoomManager.shared.messageService.sendTextMessage("MESSAGE_CONTENT") { result in
// The result of send messages.
}
To receive the bullet screen messages, listen for the receiveTextMessage
method.
func receiveTextMessage(_ message: TextMessage) {
}
To send the gift messages, call the sendGift
method.
let giftModel:GiftModel = xxx // You can define the gift type as needed.
let targetUserList:[String] = ["TO_USER_ID"]
RoomManager.shared.giftService.sendGift(giftModel.giftID, to: targetUserList) { result in
// The result of send the gift messages.
}
Upon gift-sending, the All Participants receive a gift message through the callback receiveGift
with the recipient list, gift type, and the sender ID.
// Receives the gift.
func receiveGift(_ giftID: String, from userID: String, to userList: [String]) {
}