The ZIMMessageSentCallback in ZIM Flutter sendMessage interface does not expose errorcode. How to get it?
2024-07-03
Products / Plugins:In-app chat
Platform / Framework:Flutter
You can get the errorcode by catching the PlatformException exception. For details, please refer to the following code snippet.
try {
var ret = await ZIM.getInstance()!.sendMessage(
message,
obj.toUserID,
ZIMConversationType.peer,
config,
messageSendNotification);
}
on PlatformException catch (onError) {
onError.code; onError.message;
}