diff --git a/example/lib/src/rtm_api_demo.dart b/example/lib/src/rtm_api_demo.dart index 42e746d..ace29f7 100644 --- a/example/lib/src/rtm_api_demo.dart +++ b/example/lib/src/rtm_api_demo.dart @@ -1,5 +1,6 @@ import 'dart:collection'; import 'dart:convert'; +import 'dart:typed_data'; import 'package:agora_rtm/agora_rtm.dart'; import 'package:flutter/material.dart'; @@ -372,7 +373,8 @@ class _RtmApiDemoState extends State { _button('RtmClient.publishBinaryMessage', () async { final result = await _rtmClient.publishBinaryMessage( _channelNameController.text, - utf8.encode(_rtmClientMessageController.text), + Uint8List.fromList( + utf8.encode(_rtmClientMessageController.text)), channelType: _rtmChannelType, messageType: RtmMessageType.rtmMessageTypeBinary, customType: _rtmClientPublishCustomTypeController.text);