You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
open-im-sdk-flutter-m/windows/src/common/FLTService.cpp

65 lines
2.6 KiB

// Copyright (c) 2022 NetEase, Inc. All rights reserved.
// Use of this source code is governed by a MIT license that can be
// found in the LICENSE file.
#include "FLTService.h"
#include "../FLTConvert.h"
std::string FLTService::getServiceName() const { return m_serviceName; }
void notifyEvent(const std::string& eventName,
flutter::EncodableMap& arguments) {
arguments.insert(std::make_pair(flutter::EncodableValue("serviceName"),
flutter::EncodableValue("")));
std::string strLog;
strLog.append("en: ")
.append(eventName)
.append(", args: ")
.append(Convert::getInstance()->getStringFormMapForLog(&arguments));
std::list<std::string> logList;
Convert::getInstance()->getLogList(strLog, logList);
for (auto& it : logList) {
YXLOG_API(Info) << it << YXLOGEnd;
}
NimCore::getInstance()->invokeMethod(eventName, arguments);
YXLOG_API(Info) << "notifyEvent invoke completation." << YXLOGEnd;
}
//void FLTService::notifyEvent(const std::string& eventName,
// flutter::EncodableMap& arguments,
// const NimCore::InvokeMehtodCallback& callback) {
// arguments.insert(std::make_pair(flutter::EncodableValue("serviceName"),
// flutter::EncodableValue(m_serviceName)));
// std::string strLog;
// strLog.append("en: ")
// .append(eventName)
// .append(", args: ")
// .append(Convert::getInstance()->getStringFormMapForLog(&arguments));
// std::list<std::string> logList;
// Convert::getInstance()->getLogList(strLog, logList);
// for (auto& it : logList) {
// YXLOG_API(Info) << it << YXLOGEnd;
// }
// NimCore::getInstance()->invokeMethod(eventName, arguments, callback);
// YXLOG_API(Info) << "notifyEvent invoke completation." << YXLOGEnd;
//}
void FLTService::notifyEventEx(const std::string& serviceName,
const std::string& eventName,
flutter::EncodableMap& arguments) {
arguments.insert(std::make_pair(flutter::EncodableValue("serviceName"),
flutter::EncodableValue(serviceName)));
std::string strLog;
strLog.append("en: ")
.append(eventName)
.append(", args: ")
.append(Convert::getInstance()->getStringFormMapForLog(&arguments));
std::list<std::string> logList;
Convert::getInstance()->getLogList(strLog, logList);
for (auto& it : logList) {
YXLOG_API(Info) << it << YXLOGEnd;
}
NimCore::getInstance()->invokeMethod(eventName, arguments);
YXLOG_API(Info) << "notifyEventEx invoke completation." << YXLOGEnd;
}