7#ifndef _NIM_SDK_CPP_CLIENT_H_
8#define _NIM_SDK_CPP_CLIENT_H_
28class NIM_SDK_CPPWRAPPER_DLL_API
Client {
31 typedef std::function<void(
const std::function<
void()>&)>
SDKClosure;
61 static bool Init(
const std::string& app_key,
const std::string& app_data_dir,
const std::string& app_install_dir,
const SDKConfig& config);
68 static void SetCallbackFunction(
const SDKClosure& callback);
81 static void Cleanup(
const std::string& json_extension =
"");
88 static void Cleanup2(
const std::string& json_extension =
"");
96 static void LoginCustomDataToJson(
const LoginParams& params, std::string& loginParams);
104 static void LoginCustomDataToJson(
const std::string& custom_data, std::string& strValue);
124 static bool Login(
const std::string& app_key,
125 const std::string& account,
126 const std::string& password,
128 const std::string& json_extension =
"");
135 static NIMLoginState GetLoginState(
const std::string& json_extension =
"");
142 static void Relogin(
const std::string& json_extension =
"");
160 static bool KickOtherClient(
const std::list<std::string>& client_ids);
176 static void RegReloginCb(
const LoginCallback& cb,
const std::string& json_extension =
"");
193 static void RegKickoutCb(
const KickoutCallback& cb,
const std::string& json_extension =
"");
201 static void RegDisconnectCb(
const DisconnectCallback& cb,
const std::string& json_extension =
"");
209 static void RegMultispotLoginCb(
const MultiSpotLoginCallback& cb,
const std::string& json_extension =
"");
218 static void RegKickOtherClientCb(
const KickOtherCallback& cb,
const std::string& json_extension =
"");
236 static void SetMultiportPushConfigAsync(
bool switch_on,
const MultiportPushConfigCallback& cb,
const std::string& json_extension =
"");
250 static std::string GetSDKVersion();
256 static std::string GetCurrentUserAccount();
273 static void UnregClientCb();
全局管理功能;主要包括SDK初始化/清理、客户端登录/退出等功能
Definition: nim_cpp_client.h:28
std::function< void(void)> DisconnectCallback
断网通知回调模板
Definition: nim_cpp_client.h:41
std::function< void(const MultiSpotLoginRes &)> MultiSpotLoginCallback
多端登录通知回调模板
Definition: nim_cpp_client.h:43
std::function< void(const LoginRes &)> LoginCallback
登录回调模板
Definition: nim_cpp_client.h:33
std::function< void(const KickoutRes &)> KickoutCallback
被踢通知回调模板
Definition: nim_cpp_client.h:39
std::function< void(std::string *)> ReloginRequestTokenCallback
自动重连时请求新的鉴权回调
Definition: nim_cpp_client.h:35
std::function< void(int, bool)> MultiportPushConfigCallback
多端推送控制开关回调模板
Definition: nim_cpp_client.h:47
std::function< void(int, bool, uint64_t)> GetCurrentServerTimeCallback
查询服务器当前时间回调模板
Definition: nim_cpp_client.h:49
std::function< void(const std::function< void()> &)> SDKClosure
默认回调模板
Definition: nim_cpp_client.h:31
std::function< void(const KickOtherRes &)> KickOtherCallback
将多端下线回调模板
Definition: nim_cpp_client.h:45
std::function< void(NIMResCode)> LogoutCallback
登出回调模板
Definition: nim_cpp_client.h:37
void UnregNIMCallback()
Definition: nim_cpp_client.cpp:148
NIMResCode
Definition: nim_chatroom_res_code_def.h:15
NIMLoginState
Definition: nim_client_def.h:73
NIMLogoutType
Definition: nim_client_def.h:91
踢人结果回调信息
Definition: nim_client_helper.h:250
被踢结果回调信息
Definition: nim_client_helper.h:230
Definition: nim_client_helper.h:266
登录结果回调信息
Definition: nim_client_helper.h:212
多端登录回调信息
Definition: nim_client_helper.h:242
SDK设置项
Definition: nim_client_helper.h:26