Browse SDKs · Flutter
SDKsFlutter

Create a custom message

Create a structured application-defined message with the OpenIM Flutter SDK.

Copy
final message = await OpenIM.iMManager.messageManager.createCustomMessage(
  data: jsonEncode({'version': 1, 'orderID': orderID}),
  extension: jsonEncode({'schema': 'com.example.order'}),
  description: 'Order card',
);

Recipients should validate the protocol version and fields. The application service must remain the authority for business state. The Future returns an object waiting to be sent.