Future<bool> reportEvent(int eventId, String eventName, AppInfo appInfo,Map<Object?, Object?> params) async {return false;}
@overrideFuture<bool> reportEvent(int eventId, String eventName, AppInfo appInfo,Map<Object?, Object?> params) async {print("reportEvent:$eventName appinfo:$appInfo params:$params");// TODO: implement reportEventreturn true;}
/// Register SDK for message callback event monitoring, which can be marked/// based on EventConfig annotation to indicate whether to intercept events,/// such as log events, etcvoid registerMessageEventHandler(TcmppFlutterEventChannel handler)
_tcmppFlutterPlugin.registerMessageEventHandler(TcmppFlutterEventChannelImpl());
@EventConfig(value: true)@overrideFuture<void> uploadUserLog(String appId, String logPath) async {print("SupperAppCustom uploadUserLog:${logPath}");}
...dev_dependencies:build_runner: ^2.4.6flutter:assets:- lib/generated/tcmpp_event_config.json
flutter pub run build_runner build --delete-conflicting-outputs
{"isUpdateBaseLib": true,"uploadUserLog": true,"reportRealTimeLog": false}
/*** Real-time log callback* @param RealTimeLogInfo Log information*/Future<void> reportRealTimeLog(RealTimeLogInfo? logInfo) async {}
class RealTimeLogInfo {/// The current pageString page;/// Base library versionString jsLibVersion;/// Mini program appidString appId;/// Filter keywordsList<String> filterMsgs;/// LogsList<LogItem> logs;}class LogItem {/// Log timeint time;/// Log levelint level;/// Log informationString msg;/// Log tagString tag;/// Log keywordsString key;}
@EventConfig(value: true)@overrideFuture<void> reportRealTimeLog(RealTimeLogInfo? logInfo) async {print("SupperAppCustom reportRealTimeLog:${logInfo}");}
Future<void> uploadUserLog(String appId, String logPath) async {}
@EventConfig(value: true)@overrideFuture<void> uploadUserLog(String appId, String logPath) async {print("SupperAppCustom uploadUserLog:${logPath}");}
Future<void> isUpdateBaseLib(Map<dynamic, dynamic>? data) async {}
@EventConfig(value: true)@overrideFuture<void> isUpdateBaseLib(Map<dynamic, dynamic>? data) async {print("isUpdateBaseLib:${data}");}
Was this page helpful?
You can also Contact sales or Submit a Ticket for help.
Help us improve! Rate your documentation experience in 5 mins.
Feedback