floo::BMXUserServiceListener

用户状态监听者

#include <bmx_user_service_listener.h>

Public Functions

Name
BMXUserServiceListener()
构造函数
virtual ~BMXUserServiceListener()
析构函数
virtual void onConnectStatusChanged(BMXConnectStatus status)
链接状态发生变化
virtual void onUserSignIn(BMXUserProfilePtr profile)
用户登陆
virtual void onUserSignOut(BMXErrorCode error, int64_t userId)
用户登出
virtual void onInfoUpdated(BMXUserProfilePtr profile)
同步用户信息更新(其他设备操作发生用户信息变更)
virtual void onOtherDeviceSingIn(int deviceSN)
用户在其他设备上登陆
virtual void onOtherDeviceSingOut(int deviceSN)
用户在其他设备上登出
void registerUserService(BMXUserService * service)
注册BMXUserServiceListener绑定到的BMXUserService(SDK内部自动注册)

Protected Attributes

Name
BMXUserService * mService

Public Functions Documentation

function BMXUserServiceListener

inline BMXUserServiceListener()

构造函数

Example:

function ~BMXUserServiceListener

inline virtual ~BMXUserServiceListener()

析构函数

Example:

function onConnectStatusChanged

inline virtual void onConnectStatusChanged(
    BMXConnectStatus status
)

链接状态发生变化

Parameters:

  • status 连接状态

Example:

void UserListener::onConnectStatusChanged(BMXConnectStatus status) {
  draw_notify(notifyWindow);
  mvwaddstr(notifyWindow, 1, 1, "UserListener onConnectStatusChanged");
  switch (status) {
    case BMXConnectStatus::Disconnected:
      mvwaddstr(notifyWindow, 2, 1, "Disconnected");
      break;
    case BMXConnectStatus::Connected:
      mvwaddstr(notifyWindow, 2, 1, "Connected");
      break;
    default:
      break;
  }
  touchwin(stdscr);
  refresh();

function onUserSignIn

inline virtual void onUserSignIn(
    BMXUserProfilePtr profile
)

用户登陆

Parameters:

  • profile 用户profile

Example:

void UserListener::onUserSignIn(BMXUserProfilePtr profile) {
  draw_notify(notifyWindow);
  mvwaddstr(notifyWindow, 1, 1, "UserListener onUserSignIn");
  touchwin(stdscr);
  refresh();

function onUserSignOut

inline virtual void onUserSignOut(
    BMXErrorCode error,
    int64_t userId
)

用户登出

Parameters:

  • error 状态错误码

Example:

void UserListener::onUserSignOut(BMXErrorCode error) {
  draw_notify(notifyWindow);
  mvwaddstr(notifyWindow, 1, 1, "UserListener onUserSignOut");
  touchwin(stdscr);
  refresh();

function onInfoUpdated

inline virtual void onInfoUpdated(
    BMXUserProfilePtr profile
)

同步用户信息更新(其他设备操作发生用户信息变更)

Parameters:

  • profile 用户profile

Example:

function onOtherDeviceSingIn

inline virtual void onOtherDeviceSingIn(
    int deviceSN
)

用户在其他设备上登陆

Parameters:

  • deviceSN 设备序列号

Example:

void UserListener::onOtherDeviceSingIn(int deviceSN) {
  draw_notify(notifyWindow);
  mvwaddstr(notifyWindow, 1, 1, "UserListener onOtherDeviceSingIn");
  mvwaddstr(notifyWindow, 2, 1, std::to_string(deviceSN).c_str());
  touchwin(stdscr);
  refresh();

function onOtherDeviceSingOut

inline virtual void onOtherDeviceSingOut(
    int deviceSN
)

用户在其他设备上登出

Parameters:

  • deviceSN 设备序列号

Example:

void UserListener::onOtherDeviceSingOut(int deviceSN) {
  draw_notify(notifyWindow);
  mvwaddstr(notifyWindow, 1, 1, "UserListener onOtherDeviceSingOut");
  mvwaddstr(notifyWindow, 2, 1, std::to_string(deviceSN).c_str());
  touchwin(stdscr);
  refresh();

function registerUserService

inline void registerUserService(
    BMXUserService * service
)

注册BMXUserServiceListener绑定到的BMXUserService(SDK内部自动注册)

Parameters:

Protected Attributes Documentation

variable mService

BMXUserService * mService;

Example:


Updated on 2022-01-26 at 17:20:40 +0800

© 2019-2022 美信拓扑 | 官网 该文件修订时间: 2022-09-21 11:43:07

results matching ""

    No results matching ""