Browse SDKs · uni-app / uni-app x
Platform
SDKsuni-app / uni-app x

Set group extension data

Store custom application-level extension strings on a specified group.

Copy

The ex property stores an opaque string; the SDK does not perform automatic JSON merging. When multiple application modules share this attribute, structure namespaces carefully and retain other fields before writing.

Parameters

ParameterTypeRequiredDescription
groupIDstringYesTarget group identifier.
exstringYesCustom extension string; completely overwrites existing group extension data.

Code example

import { setGroupInfo } from '@/uni_modules/unix-openim-sdk'

await setGroupInfo({
  groupID,
  ex: JSON.stringify({ projectID: 'project-42' }),
})

If the group already contains extension data, retrieve the current value, merge changes within your application layer, and submit the entire serialized string.

Return value

The Promise resolves with void once OpenIMServer updates the group extension data.

State changes after the call

A resolved Promise confirms that the extension string was saved. Update the local group's ex field optimistically, and confirm final state when onGroupInfoChanged arrives matching groupID. For complete group event listener registration, see Group overview.