Browse SDKs · WASM
SDKsWASM

Create a location message

Create a location message with the WASM SDK.

Copy

Parameters

ParameterTypeRequiredDescription
descriptionstringYesLocation name or address description.
longitudenumberYesLongitude.
latitudenumberYesLatitude.
const { data: message } = await openimsdk.createLocationMessage({
  description: 'Pudong, Shanghai',
  longitude: 121.4737,
  latitude: 31.2304,
});

Obtain the location only after receiving the user's permission, and control its precision according to your product's privacy policy. When the Promise resolves, it returns only a pending message object.