7#ifndef _NIM_SDK_CPP_CLIENT_H_
8#define _NIM_SDK_CPP_CLIENT_H_
31 typedef std::function<void(
const std::function<
void()>&)>
SDKClosure;
68 static bool Init(
const std::string& app_key,
const std::string& app_data_dir,
const std::string& app_install_dir,
const SDKConfig& config);
75 static void SetCallbackFunction(
const SDKClosure& callback);
88 static void Cleanup(
const std::string& json_extension =
"");
95 static void Cleanup2(
const std::string& json_extension =
"");
103 static void LoginCustomDataToJson(
const LoginParams& params, std::string& loginParams);
111 static void LoginCustomDataToJson(
const std::string& custom_data, std::string& strValue);
136 static bool Login(
const std::string& app_key,
137 const std::string& account,
138 const std::string& password,
140 const std::string& json_extension =
"");
147 static NIMLoginState GetLoginState(
const std::string& json_extension =
"");
155 static void Relogin(
const std::string& json_extension =
"");
177 static bool KickOtherClient(
const std::list<std::string>& client_ids);
197 static void RegReloginCb(
const LoginCallback& cb,
const std::string& json_extension =
"");
227 static void RegKickoutCb(
const KickoutCallback& cb,
const std::string& json_extension =
"");
237 static void RegDisconnectCb(
const DisconnectCallback& cb,
const std::string& json_extension =
"");
247 static void RegMultispotLoginCb(
const MultiSpotLoginCallback& cb,
const std::string& json_extension =
"");
258 static void RegKickOtherClientCb(
const KickOtherCallback& cb,
const std::string& json_extension =
"");
280 static void SetMultiportPushConfigAsync(
bool switch_on,
const MultiportPushConfigCallback& cb,
const std::string& json_extension =
"");
298 static std::string GetSDKVersion();
304 static std::string GetCurrentUserAccount();
323 static void UnregClientCb();
全局管理功能;主要包括SDK初始化/清理、客户端登录/退出等功能
Definition: nim_cpp_client.h:28
std::function< void(std::string *)> RequestExtensionCallback
登录时请求第三方鉴权扩展信息回调
Definition: nim_cpp_client.h:37
std::function< void(void)> DisconnectCallback
断网通知回调
Definition: nim_cpp_client.h:43
std::function< void(const MultiSpotLoginRes &)> MultiSpotLoginCallback
多端登录通知回调
Definition: nim_cpp_client.h:45
std::function< void(const LoginRes &)> LoginCallback
登录回调
Definition: nim_cpp_client.h:33
std::function< void(const KickoutRes &)> KickoutCallback
被踢通知回调
Definition: nim_cpp_client.h:41
std::function< void(std::string *)> ReloginRequestTokenCallback
登录时请求新的鉴权回调
Definition: nim_cpp_client.h:35
std::function< void(int, bool)> MultiportPushConfigCallback
多端推送控制开关回调
Definition: nim_cpp_client.h:49
std::function< void(int, bool, uint64_t)> GetCurrentServerTimeCallback
查询服务器当前时间回调
Definition: nim_cpp_client.h:51
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:47
std::function< void(NIMResCode)> LogoutCallback
登出回调
Definition: nim_cpp_client.h:39
void UnregNIMCallback()
Definition: nim_cpp_client.cpp:148
NIMLoginState
Definition: nim_client_def.h:73
NIMLogoutType
Definition: nim_client_def.h:91
#define NIM_SDK_CPPWRAPPER_DLL_API
Definition: nim_sdk_cpp_wrapper.h:38
NIMResCode
Definition: public_defines.h:21
踢人结果回调信息
Definition: nim_client_helper.h:278
被踢结果回调信息
Definition: nim_client_helper.h:258
Definition: nim_client_helper.h:294
登录结果回调信息
Definition: nim_client_helper.h:240
多端登录回调信息
Definition: nim_client_helper.h:270
SDK初始化参数
Definition: nim_client_helper.h:25