client-sdk-flutter icon indicating copy to clipboard operation
client-sdk-flutter copied to clipboard

[bug] localParticipant can not setName setMetadata setAttributes

Open ghost opened this issue 8 months ago • 2 comments

Describe the bug

localParticipant can not setName setMetadata setAttributes

print([_duration, permissions.canPublish, permissions.canPublishData, permissions.canSubscribe, permissions.canUpdateMetadata]); // canUpdateMetadata -> false
widget.room.localParticipant?.setName(UserStore.to.userModel.userName);
widget.room.localParticipant?.setMetadata(UserStore.to.userModel.toJson());
widget.room.localParticipant?.setAttributes(UserStore.to.userModel.toMap());
print(widget.room.localParticipant?.metadata);
print(widget.room.localParticipant?.attributes);

how to set canUpdateOwnMetadata = true

/**
   * Sets and updates the metadata of the local participant.
   * Note: this requires `canUpdateOwnMetadata` permission.
   * method will throw if the user doesn't have the required permissions
   * @param metadata
   */
  async setMetadata(metadata: string): Promise<void> {
    await this.requestMetadataUpdate({ metadata });
  }

To Reproduce

Expected behavior

Platform information

  • Flutter version:
  • Plugin version:
  • Flutter target OS:
  • Flutter target OS version:
  • Flutter console log:

ghost avatar Apr 27 '25 02:04 ghost