sendChatroomLocationMessage method
发送聊天室地理位置消息
Implementation
Future<NIMResult<NIMChatroomMessage>> sendChatroomLocationMessage({
required String roomId,
required double latitude,
required double longitude,
required String address,
bool resend = false,
ChatroomMessageAction? action,
}) async {
return _createMessage({
'roomId': roomId,
'latitude': latitude,
'longitude': longitude,
'address': address,
'messageType': 'location',
}).then((messageResult) async {
if (messageResult.isSuccess) {
final message = messageResult.data as NIMChatroomMessage;
await action?.call(message);
return sendChatroomMessage(message, resend);
} else {
return messageResult;
}
});
}