sendOnlineMessage method

  1. @override
Future<int> sendOnlineMessage(
  1. String userId,
  2. String content
)
override

发送在线消息

消息发送结果通过 @ref JCClientCallback#onOnlineMessageSendResult "onOnlineMessageSendResult" 通知

@note

  • 当前对方只有在线才能收到此消息
  • 此接口调用频次限制 100次/分钟

userId 对方的 userId content 要发送的消息内容 @return

  • >0:成功返回操作id,与回调中的 operationId 一致
  • -1:失败,不会触发消息发送结果回调

Implementation

@override
Future<int> sendOnlineMessage(String userId, String content) async {
  return await NativeImpl.methodChannel.invokeMethod(
      '${methodTag}sendOnlineMessage',
      {'userId': userId, 'content': content});
}