setMetadata

public final Unit setMetadata(Map<String, String> metadata)

Message metadata in key-value format, supports remote sync.


public final Unit setMetadata(Map<String, String> metadata, ErrorHandler handler)

Updates message metadata.

Sets or updates key-value metadata for this message, with remote sync support.

message.setMetadata(mapOf("read_count" to "10", "liked" to "true")) { error ->
if (error == null) {
// Updated successfully
}
}

Parameters

metadata

Key-value pairs to update; existing keys will be overwritten

handler

Operation result callback; error is null on success