no message

This commit is contained in:
cpdl
2025-05-07 17:35:06 +08:00
parent b2c3c09c20
commit ee0cea6c2b
3 changed files with 24 additions and 3 deletions

View File

@@ -18,6 +18,20 @@ class MyApp extends StatefulWidget {
}
class _MyAppState extends State<MyApp> {
Future<void> send() async {
OpenIM.iMManager.messageManager
.sendMessage(
userID: "724f91aceb434a28a1cd10f5564b2c68",
message: await OpenIM.iMManager.messageManager
.createTextMessage(text: 'hello openim'),
offlinePushInfo: OfflinePushInfo(title: 'title', desc: 'desc'))
.then((value) {
print('send success');
}).catchError((error) {
print('send error');
});
}
@override
void initState() {
super.initState();
@@ -39,6 +53,7 @@ class _MyAppState extends State<MyApp> {
.then((value) {
List<String> list = [];
OpenIM.iMManager.userManager.subscribeUsersStatus(list);
send();
OpenIM.iMManager.conversationManager
.getAllConversationList()
.then((value) {