insertC2CMessageToLocalStorage method Null safety

Future<V2TimValueCallback<V2TimMessage>> insertC2CMessageToLocalStorage(
  1. {required String data,
  2. required String userID,
  3. required String sender}
)

Add a message to the message list of a one-to-one chat

This API can be used to insert reminders such as “You have sent the message successfully” to a one-to-one chat. It’s necessary to display such messages to the local user, but not to other users. In this sense, the insertC2CMessageToLocalStorage() API is equivalent to sendMessage() with the message sending capability disabled.

data is similar to data in customMessage
groupID group id
sender sender

Return to [V2TimMessage]

Messages saved via this API are saved only to the local storage and will get lost after the app is uninstalled.

Note: web does not support this interface

Implementation

Future<V2TimValueCallback<V2TimMessage>> insertC2CMessageToLocalStorage({
  required String data,
  required String userID,
  required String sender,
}) async {
  return await ImFlutterPlatform.instance.insertC2CMessageToLocalStorage(
      data: data, userID: userID, sender: sender);
}