Cannot update metadata

Since 3.0.108, I got error SendBirdException: Invalid parameter when try to update channel metadata via updateMetaData. Is there any update on this?

@Daniel_Jung that version is quite awhile ago. What is your input for updateMetaData?

Yes, it’s quite old version because I’m stuck with this issue. Here is the code snippet:

  setWriterOnline(channel: GroupChannel, isOnline: boolean): Promise<object> {
    return new Promise((resolve, reject) => {
      const metaDataMap = { is_writer_online: isOnline, is_writer_chatted: false };
      channel.updateMetaData(metaDataMap, (response, error) => (error ? reject(error) : resolve(response)));
    });
  },

As you see, I just passed an object, that’s all. And I got the following error:

SendBirdException
800110

which means “Invalid Parameter - The parameter of the method specifies an invalid value”. I’ve also checked with latest version(3.0.127) and it is still happening.

Did metaData keys create before?

Have you tried this before?

Is there an option to directly create the metadata key value pair on a message?

From the documentation, I see that we need to create the metadata key first and then add a value to it. https://docs.sendbird.com/javascript/group_channel_advanced#3_add_extra_data_to_a_message

@Harsha_Nooka you can use metaArrays in UserMessageParam to add meta data on sending a message https://sendbird.github.io/core-sdk-javascript/module-model_params_userMessageParams-UserMessageParams.html