no message
This commit is contained in:
@@ -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;
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user