Browse Source

fix(android): 指定可用的NDK版本以避免编译错误

- 在build.gradle.kts中硬编码NDK版本为27.0.12077973
- 添加注释说明覆盖flutter.ndkVersion的原因
- 确保项目使用系统上实际存在的NDK版本进行构建

feat(im): 增加消息发送成功与失败的日志记录

- 在IMManager中注册ChatMessageEvent监听器
- 记录发送消息成功的日志信息
- 记录发送消息失败时的错误详情和描述

fix(ui): 页面返回时关闭SmartDialog提示框

- 在LiveRoomPage的onPopInvokedWithResult回调中调用SmartDialog.dismiss()
- 防止页面切换时残留对话框影响用户体验
ios
Jolie 3 months ago
parent
commit
3f0a6c7c47
3 changed files with 12 additions and 2 deletions
  1. 4
      android/app/build.gradle.kts
  2. 9
      lib/im/im_manager.dart
  3. 1
      lib/pages/discover/live_room_page.dart

4
android/app/build.gradle.kts

@ -8,7 +8,9 @@ plugins {
android {
namespace = "com.juxinghe.touchme"
compileSdk = flutter.compileSdkVersion
ndkVersion = flutter.ndkVersion
// Use a specific NDK version that is available on the system
// If flutter.ndkVersion points to a missing/corrupted NDK, override it
ndkVersion = "27.0.12077973"
compileOptions {
sourceCompatibility = JavaVersion.VERSION_11

9
lib/im/im_manager.dart

@ -132,7 +132,14 @@ class IMManager {
},
),
);
EMClient.getInstance.chatManager.addMessageEvent(_chatHandlerKey, ChatMessageEvent(
onSuccess: (str, message){
Get.log('✅ [IMManager] 发送消息成功: $str');
},
onError: (str, message, err){
Get.log('❌ [IMManager] 发送消息失败: $err----$str');
},
));
_listenersRegistered = true;
if (Get.isLogEnable) {
Get.log('✅ [IMManager] 监听器注册成功');

1
lib/pages/discover/live_room_page.dart

@ -107,6 +107,7 @@ class _LiveRoomPageState extends State<LiveRoomPage> {
Widget build(BuildContext context) {
return PopScope(
onPopInvokedWithResult: (bool didPop, Object? result) async {
SmartDialog.dismiss();
_overlayController.show();
Get.back();
},

Loading…
Cancel
Save