Search code examples
getstream-io

getstream.io - How do I set the Channel.Config to disable reactions?


Im using the iOS SDK and I would like to turn off reactions for my users in chat.

In my subclass of ChatViewController I have overridden defaultMessageActions:

override var defaultMessageActions: ChatViewController.MessageAction {
    return [.delete, .copy, .flagMessage, .flagUser]
}

However, when a user taps on a message cell, the reaction window still pops up. I found where there is happening in ChatViewController+Cells.swift:

if let presenter = presenter, presenter.channel.config.reactionsEnabled {
    showReactions(from: cell, in: message, locationInView: tapGesture.location(in: cell))
}

reactionsEnabled is true here and so the reactions view is popping up. I tried to find a away to set Channel.Config.reactionsEnabled to false, but had no success.

How do I set reactionsEnabled to false? Any help would be appreciated.


Solution

  • The correct way to disable reactions is to go to your Stream Chat dashboard, select the channel types you don't want reactions enabled for, disable it and save. After that, the reactions UI will not be displayed.

    enter image description here

    Disabling just from client-side like you were trying to do is not supported with the provided UI components.