Error reacting to a message

Getting this error when attempting to react to an admin message SendBirdException: Cannot add reaction to a non-succeeded message. but not other messages

You can add reactions to messages sent by users but not Admin.
For this example below, make sure “groupChannel” and “message” are valid Sendbird objects.

    const emojiKey = "smile";
    groupChannel.addReaction(message, emojiKey, (reactionEvent, error) => {
        if (!error) {
            message.applyReactionEvent(reactionEvent);
        } else {
            console.dir(error);
        }
    });

Thanks for the response :+1:

You can add reactions to messages sent by users but not Admin.

Is this documented somewhere? I ask because it appears our ios team was able to add reactions to admin messages.

Hi @Jrml. Yes, you can find it here

let emojiKey = "smile"
// The BASE_MESSAGE below indicates an SBDBaseMessage object to add a reaction to.
groupChannel.addReaction(with: BASE_MESSAGE, key: emojiKey, completionHandler: { (reactionEvent, error) in
    guard error == nil else {   // Error. 
        return
    }
})

// The BASE_MESSAGE below indicates an SBDBaseMessage object to delete a reaction from.
groupChannel.deleteReaction(with: BASE_MESSAGE, key: emojiKey, completionHandler: { (reactionEvent, error) in
    guard error == nil else {   // Error.
        return
    }
})

// Note: To add or remove the emoji of which key matches "smile" below the message on the current user's chat view,
// the 'apply()' method should be called in the channel event heandler's 'updatedReaction()' method.