Documentation
TalkingRoom Live Audio Room
Documentation
Demo APP
SDK Center
API Center
FAQ
Code Market
Console
Sign Up
Log In
中文站 English
  • Documentation
  • Live Audio Room
  • Guides
  • Manage messages

Manage messages

Last updated:2022-03-22 13:07

Managing the messages is an important session to realize the signaling synchronization in the Live Audio Room. This document describes how to manage messages.


Prerequisites

  • Contact the ZEGO sales team or pre-sales engineer to configure the Live Audio Room (RTC + IM) service.
  • Refer to the Getting started to create a room and join a room.

Send/Receive bullet screen 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) {

}

Send/Receive gift messages

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]) {

}
Page Directory
  • Free trial
  • 提交工单
    咨询集成、功能及报价等问题
    电话咨询
    400 1006 604
    Get Consulting
    Scan Wechat QR code