no message

This commit is contained in:
cpdl
2025-05-06 17:25:49 +08:00
parent 43515d8058
commit 67bf71c998
35 changed files with 4216 additions and 296 deletions

View File

@@ -5,6 +5,7 @@
#include "FLTService.h"
#include "../FLTConvert.h"
#include "ThreadUtil.h"
std::string FLTService::getServiceName() const { return m_serviceName; }
@@ -22,8 +23,16 @@ void notifyEvent(const std::string& eventName,
for (auto& it : logList) {
YXLOG_API(Info) << it << YXLOGEnd;
}
NimCore::getInstance()->invokeMethod(eventName, arguments);
YXLOG_API(Info) << "notifyEvent invoke completation." << YXLOGEnd;
// Create shared pointers for the data to ensure copy constructibility
auto eventNameCopy = std::make_shared<std::string>(eventName);
auto argsCopy = std::make_shared<flutter::EncodableMap>(arguments);
// Ensure we're on the platform thread
ThreadUtil::RunOnPlatformThread([eventNameCopy, argsCopy]() {
NimCore::getInstance()->invokeMethod(*eventNameCopy, *argsCopy);
YXLOG_API(Info) << "notifyEvent invoke completation." << YXLOGEnd;
});
}
//void FLTService::notifyEvent(const std::string& eventName,
@@ -60,6 +69,14 @@ void FLTService::notifyEventEx(const std::string& serviceName,
for (auto& it : logList) {
YXLOG_API(Info) << it << YXLOGEnd;
}
NimCore::getInstance()->invokeMethod(eventName, arguments);
YXLOG_API(Info) << "notifyEventEx invoke completation." << YXLOGEnd;
// Create shared pointers for the data to ensure copy constructibility
auto eventNameCopy = std::make_shared<std::string>(eventName);
auto argsCopy = std::make_shared<flutter::EncodableMap>(arguments);
// Ensure we're on the platform thread
ThreadUtil::RunOnPlatformThread([eventNameCopy, argsCopy]() {
NimCore::getInstance()->invokeMethod(*eventNameCopy, *argsCopy);
YXLOG_API(Info) << "notifyEventEx invoke completation." << YXLOGEnd;
});
}