|
|
@@ -7,6 +7,7 @@ import 'package:get/get.dart';
|
|
|
import 'package:injectable/injectable.dart';
|
|
|
import 'package:keyboard/data/repository/chat_repository.dart';
|
|
|
import 'package:keyboard/data/repository/keyboard_repository.dart';
|
|
|
+import 'package:keyboard/handler/event_handler.dart';
|
|
|
import 'package:keyboard/module/keyboard_manage/keyboard_manage_controller.dart';
|
|
|
import 'package:keyboard/module/main/main_controller.dart';
|
|
|
import 'package:keyboard/utils/atmob_log.dart';
|
|
|
@@ -55,7 +56,8 @@ class KeyboardMethodHandler {
|
|
|
return _handleChatPrologue(call);
|
|
|
case 'jumpAppPage':
|
|
|
return _handleJumpAppPage(call);
|
|
|
-
|
|
|
+ case 'reportEvent':
|
|
|
+ return _handleReportEvent(call);
|
|
|
default:
|
|
|
throw MissingPluginException('Not implemented: ${call.method}');
|
|
|
}
|
|
|
@@ -229,6 +231,7 @@ class KeyboardMethodHandler {
|
|
|
parameters: parsedArgs.map((k, v) => MapEntry(k, v.toString())),
|
|
|
);
|
|
|
}
|
|
|
+
|
|
|
// 如果目标页面已存在,则删除其他页面,并拉起目标页面,手动传参
|
|
|
if (path == RoutePath.mainTab) {
|
|
|
if (Get.isRegistered<MainController>()) {
|
|
|
@@ -259,6 +262,15 @@ class KeyboardMethodHandler {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ Future<String> _handleReportEvent(MethodCall call) async {
|
|
|
+ final String eventId = call.arguments['eventId'] ?? "";
|
|
|
+ final Map<String, dynamic>? params = call.arguments['params'];
|
|
|
+ if (eventId.isNotEmpty) {
|
|
|
+ EventHandler.report(eventId, params: params);
|
|
|
+ }
|
|
|
+ return '{}';
|
|
|
+ }
|
|
|
+
|
|
|
String handleError(dynamic error) {
|
|
|
if (error is ServerErrorException) {
|
|
|
AtmobLog.e(tag, "接口请求失败: ${error.message}");
|