Send emoji reactions

The code on this page works with either the default UI or the custom UI.

Send and receive emoji reactions and feedback with the SDK with the MobileRTCMeetingService+Reaction.h category.

let meetingService = MobileRTC.shared().getMeetingService()
MobileRTCMeetingService *meetingService = [[MobileRTC sharedRTC] getMeetingService];

To send reactions, first check that reactions are supported in the current meeting. Then, use sendEmojiReaction, which returns a MobileRTCSDKError object.

if (meetingService?.isEmojiReactionEnabled() == true) {
    let error = meetingService?.send(.clap)
    switch error {
    case .success:
        print("Send reaction succeeded.")
    default:
        print("Send error: \(String(describing: error))")
    }
}
if ([meetingService isEmojiReactionEnabled]) {
    [meetingService sendEmojiReaction:MobileRTCEmojiReactionType_Clap];
}

Supported emojis and feedback

The MobileRTCEmojiReactionType enum currently supports only these unicode emojis.

  • Clap
  • Thumbsup
  • Heart
  • Joy
  • Openmouth
  • Tada

Emoji feedback is supported, but is done through a separate method.

meetingService?.send(.yes)
[meetingService sendEmojiFeedback:MobileRTCEmojiFeedbackType_Yes];

These feedback types are supported.

  • MobileRTCEmojiFeedbackType_Yes
  • MobileRTCEmojiFeedbackType_No
  • MobileRTCEmojiFeedbackType_SpeedUp
  • MobileRTCEmojiFeedbackType_SlowDown
  • MobileRTCEmojiFeedbackType_Away

Get reaction and feedback updates

To get updates related to emoji reaction and feedback, implement the relevant callbacks for the MobileRTCMeetingServiceDelegate protocol and set it as the delegate property.

func onEmojiReactionReceived(_ userId: UInt, reactionType type: MobileRTCEmojiReactionType, reactionSkinTone skinTone: MobileRTCEmojiReactionSkinTone) {
    // emoji reaction received: userID=\(userId) type=\(type), SkinTone=\(skinTone)
}
func onEmojiReactionReceived(inWebinar type: MobileRTCEmojiReactionType) {
    // emoji reaction received in webinar: type=\(type)
}
func onEmojiFeedbackReceived(_ userId: UInt, feedbackType type: MobileRTCEmojiFeedbackType) {
    // emoji feedback received: userID=\(userId) type=\(type)
}
func onEmojiFeedbackCanceled(_ userId: UInt) {
    emoji canceled: userID=\(userId)
}
…
meetingService.delegate = self
- (void)onEmojiReactionReceived:(NSUInteger)userId reactionType:(MobileRTCEmojiReactionType)type reactionSkinTone:(MobileRTCEmojiReactionSkinTone)skinTone
{
    NSLog(@"Emoji reaction received: userID=%@ type=%@, SkinTone=%@",@(userId), @(type), @(skinTone));
}
- (void)onEmojiReactionReceivedInWebinar:(MobileRTCEmojiReactionType)type
{
    NSLog(@"Emoji reaction received in webinar: type=%@", @(type));
}
- (void)onEmojiFeedbackReceived:(NSUInteger)userId feedbackType:(MobileRTCEmojiFeedbackType)type
{
    NSLog(@"Emoji feedback received: userID=%@ type=%@",@(userId), @(type));
}
- (void)onEmojiFeedbackCanceled:(NSUInteger)userId
{
    NSLog(@"Emoji canceled: userID=%@",@(userId));
}
…
meetingService.delegate = self;

These callbacks are triggered when any participant sends a reaction or feedback in a meeting with the user ID of the participant who sent or canceled the reaction or feedback. There is also a dedicated callback for when webinar attendees anonymously send reactions.