EMMessage.createLocationSendMessage constructor

EMMessage.createLocationSendMessage(
  1. {required String targetId,
  2. required double latitude,
  3. required double longitude,
  4. String? address,
  5. String? buildingName,
  6. ChatType chatType = ChatType.Chat}
)

创建一条待发送的位置信息。

Param targetId 消息接收方,可以是:

  • 用户:用户 ID;
  • 群组:群组 ID;
  • 聊天室:聊天室 ID。

Param latitude 纬度。

Param longitude 经度。

Param address 地址。

Param buildingName 建筑物名称。

Param chatType 聊天类型, 默认为单聊,如果是群聊或者聊天室,可以参考ChatType

Return 消息体实例。

Implementation

EMMessage.createLocationSendMessage({
  required String targetId,
  required double latitude,
  required double longitude,
  String? address,
  String? buildingName,
  ChatType chatType = ChatType.Chat,
}) : this.createSendMessage(
          chatType: chatType,
          to: targetId,
          body: EMLocationMessageBody(
            latitude: latitude,
            longitude: longitude,
            address: address,
            buildingName: buildingName,
          ));