im::floo::floolib::BMXUserManager

用户管理器

Public Functions

Name
BMXUserManager(BMXUserService service, BMXClient bmxClient)
void signUpNewUser(final String username, final String password, final BMXDataCallBack< BMXUserProfile > callBack)
注册
void signInByName(final String name, final String password, final BMXCallBack callBack)
用户名登陆
void signInById(final long id, final String password, final BMXCallBack callBack)
id 登陆
void autoSignInByName(final String name, final String password, final BMXCallBack callBack)
自动登陆 根据用户名
void autoSignInById(final long uid, final String password, final BMXCallBack callBack)
自动登陆 根据id
void signOut(final BMXCallBack callBack)
退出登录
void signOut(final long userId, final BMXCallBack callBack)
退出登录
[BMXConnectStatus] connectStatus()
获取当前和服务器的连接状态
[BMXSignInStatus] signInStatus()
获取当前的登录状态
void bindDevice(final String token, final BMXCallBack callBack)
绑定设备推送token
void getDeviceList(final BMXDataCallBack< BMXDeviceList > callBack)
获取登录的设备列表
void deleteDevice(final int device_sn, final BMXCallBack callBack)
删除设备
void getProfile(final boolean forceRefresh, final BMXDataCallBack< BMXUserProfile > callBack)
获取用户详情
void setNickname(final String nickname, final BMXCallBack callBack)
设置昵称
void uploadAvatar(final String avatarPath, final FileProgressListener listener, final BMXCallBack callBack)
上传头像
void downloadAvatar(final BMXUserProfile profile, final FileProgressListener listener, final BMXCallBack callBack)
下载头像
void setPublicInfo(final String publicInfo, final BMXCallBack callBack)
设置公开扩展信息
void setPrivateInfo(final String privateInfo, final BMXCallBack callBack)
设置私有扩展信息
void setAddFriendAuthMode(final BMXUserProfile.AddFriendAuthMode mode, final BMXCallBack callBack)
设置加好友验证方式
void setAuthQuestion(final BMXUserProfile.AuthQuestion authQuestion, final BMXCallBack callBack)
设置加好友验证问题
void setEnablePush(final boolean enable, final BMXCallBack callBack)
设置是否允许推送
void setEnablePushDetaile(final boolean enable, final BMXCallBack callBack)
设置是否推送详情
void setPushNickname(final String nickname, final BMXCallBack callBack)
设置推送昵称
void setPushAlias(final String alias, final String bmxPushToken, final BMXCallBack callBack)
设置推送别名
void setNotificationSound(final boolean enable, final BMXCallBack callBack)
设置收到新消息是否声音提醒
void setNotificationVibrate(final boolean enable, final BMXCallBack callBack)
设置收到新消息是否震动
void setAutoDownloadAttachment(final boolean enable, final BMXCallBack callBack)
设置是否自动缩略图和语音附件
void setAutoAcceptGroupInvite(final boolean enable, final BMXCallBack callBack)
设置是否自动同意入群邀请
void addUserListener(BMXUserServiceListener listener)
添加用户状态监听者
void removeUserListener(BMXUserServiceListener listener)
移除用户状态监听者
void changeAppId(final String appId, final BMXCallBack callBack)
切换appId

Public Functions Documentation

function BMXUserManager

inline BMXUserManager(
    BMXUserService service,
    BMXClient bmxClient
)

Example:

function signUpNewUser

inline void signUpNewUser(
    final String username,
    final String password,
    final BMXDataCallBack< BMXUserProfile > callBack
)

注册

Parameters:

Example:

public void signUpNewUser(String username, String password, BMXDataCallBack<BMXUserProfile> callBack) {
    mService.signUpNewUser(username, password, callBack);

function signInByName

inline void signInByName(
    final String name,
    final String password,
    final BMXCallBack callBack
)

用户名登陆

Parameters:

  • name
  • password
  • callBack [BMXErrorCode]

Example:

public void signInByName(String name, String password, BMXCallBack callBack) {
    mService.signInByName(name, password, callBack);

function signInById

inline void signInById(
    final long id,
    final String password,
    final BMXCallBack callBack
)

id 登陆

Parameters:

  • id
  • password
  • callBack [BMXErrorCode]

Example:

public void signInById(long id, String password, BMXCallBack callBack) {
    mService.signInById(id, password, callBack);

function autoSignInByName

inline void autoSignInByName(
    final String name,
    final String password,
    final BMXCallBack callBack
)

自动登陆 根据用户名

Parameters:

  • name
  • password
  • callBack [BMXErrorCode]

Example:

public void autoSignInByName(String name, String password, BMXCallBack callBack) {
    mService.autoSignInByName(name, password, callBack);

function autoSignInById

inline void autoSignInById(
    final long uid,
    final String password,
    final BMXCallBack callBack
)

自动登陆 根据id

Parameters:

  • uid
  • password
  • callBack [BMXErrorCode]

Example:

public void autoSignInById(long uid, String password, BMXCallBack callBack) {
    mService.autoSignInById(uid, password, callBack);

function signOut

inline void signOut(
    final BMXCallBack callBack
)

退出登录

Parameters:

  • callBack [BMXErrorCode]

Example:

public void signOut(BMXCallBack callBack) {
    mService.signOut(callBack);
public void signOut(long userId, BMXCallBack callBack) {
    mService.signOut(userId, callBack);

function signOut

inline void signOut(
    final long userId,
    final BMXCallBack callBack
)

退出登录

Parameters:

  • callBack [BMXErrorCode]

Example:

public void signOut(BMXCallBack callBack) {
    mService.signOut(callBack);
public void signOut(long userId, BMXCallBack callBack) {
    mService.signOut(userId, callBack);

function connectStatus

inline BMXConnectStatus connectStatus()

获取当前和服务器的连接状态

Example:

public BMXConnectStatus connectStatus() {
    return mService.connectStatus();

function signInStatus

inline BMXSignInStatus signInStatus()

获取当前的登录状态

Example:

public BMXSignInStatus signInStatus() {
    return mService.signInStatus();

function bindDevice

inline void bindDevice(
    final String token,
    final BMXCallBack callBack
)

绑定设备推送token

Parameters:

  • token device token
  • callBack [BMXErrorCode]

Example:

public void bindDevice(String token, BMXCallBack callBack) {
    mService.bindDevice(token, callBack);

function getDeviceList

inline void getDeviceList(
    final BMXDataCallBack< BMXDeviceList > callBack
)

获取登录的设备列表

Parameters:

  • callBack [BMXErrorCode] 登录的设备列表

Example:

public void getDeviceList(BMXDataCallBack<BMXDeviceList> callBack) {
    mService.getDeviceList(callBack);

function deleteDevice

inline void deleteDevice(
    final int device_sn,
    final BMXCallBack callBack
)

删除设备

Parameters:

  • callBack [BMXErrorCode]

Example:

public void deleteDevice(int device_sn, BMXCallBack callBack) {
    mService.deleteDevice(device_sn, callBack);

function getProfile

inline void getProfile(
    final boolean forceRefresh,
    final BMXDataCallBack< BMXUserProfile > callBack
)

获取用户详情

Parameters:

  • forceRefresh 强制从服务器拉取最新结果
  • callBack [BMXErrorCode],用户详情

Example:

public void getProfile(boolean forceRefresh, BMXDataCallBack<BMXUserProfile> callBack) {
    mService.getProfile(forceRefresh, callBack);

function setNickname

inline void setNickname(
    final String nickname,
    final BMXCallBack callBack
)

设置昵称

Parameters:

  • nickname 昵称
  • callBack [BMXErrorCode]

Example:

public void setNickname(String nickname, BMXCallBack callBack) {
    mService.setNickname(nickname, callBack);

function uploadAvatar

inline void uploadAvatar(
    final String avatarPath,
    final FileProgressListener listener,
    final BMXCallBack callBack
)

上传头像

Parameters:

  • avatarPath 头像本地文件路径
  • listener 上传进度监听器
  • callBack [BMXErrorCode]

Example:

public void uploadAvatar(String avatarPath, FileProgressListener listener, BMXCallBack callBack) {
    mService.uploadAvatar(avatarPath, listener, callBack);

function downloadAvatar

inline void downloadAvatar(
    final BMXUserProfile profile,
    final FileProgressListener listener,
    final BMXCallBack callBack
)

下载头像

Parameters:

  • profile 用户详情
  • listener 下载进度监听器
  • callBack [BMXErrorCode]

Example:

public void downloadAvatar(BMXUserProfile profile, FileProgressListener listener, BMXCallBack callBack) {
    mService.downloadAvatar(profile, listener, callBack);

function setPublicInfo

inline void setPublicInfo(
    final String publicInfo,
    final BMXCallBack callBack
)

设置公开扩展信息

Parameters:

  • publicInfo 用户公开信息
  • callBack [BMXErrorCode]

Example:

public void setPublicInfo(String publicInfo, BMXCallBack callBack) {
    mService.setPublicInfo(publicInfo, callBack);

function setPrivateInfo

inline void setPrivateInfo(
    final String privateInfo,
    final BMXCallBack callBack
)

设置私有扩展信息

Parameters:

  • privateInfo 用户私有信息(只对自己可见)
  • callBack [BMXErrorCode]

Example:

public void setPrivateInfo(String privateInfo, BMXCallBack callBack) {
    mService.setPrivateInfo(privateInfo, callBack);

function setAddFriendAuthMode

inline void setAddFriendAuthMode(
    final BMXUserProfile.AddFriendAuthMode mode,
    final BMXCallBack callBack
)

设置加好友验证方式

Parameters:

  • mode 添加好友时的验证方式
  • callBack [BMXErrorCode]

Example:

public void setAddFriendAuthMode(BMXUserProfile.AddFriendAuthMode mode, BMXCallBack callBack) {
    mService.setAddFriendAuthMode(mode, callBack);

function setAuthQuestion

inline void setAuthQuestion(
    final BMXUserProfile.AuthQuestion authQuestion,
    final BMXCallBack callBack
)

设置加好友验证问题

Parameters:

  • authQuestion 验证问题
  • callBack [BMXErrorCode]

Example:

public void setAuthQuestion(BMXUserProfile.AuthQuestion authQuestion, BMXCallBack callBack) {
    mService.setAuthQuestion(authQuestion, callBack);

function setEnablePush

inline void setEnablePush(
    final boolean enable,
    final BMXCallBack callBack
)

设置是否允许推送

Parameters:

  • enable 是否允许推送,true推送,false不推送
  • callBack [BMXErrorCode]

Example:

public void setEnablePush(boolean enable, BMXCallBack callBack) {
    mService.setEnablePush(enable, callBack);

function setEnablePushDetaile

inline void setEnablePushDetaile(
    final boolean enable,
    final BMXCallBack callBack
)

设置是否推送详情

Parameters:

  • enable 是否推送详情,true推送,false不推送
  • callBack [BMXErrorCode]

Example:

public void setEnablePushDetaile(boolean enable, BMXCallBack callBack) {
    mService.setEnablePushDetaile(enable, callBack);

function setPushNickname

inline void setPushNickname(
    final String nickname,
    final BMXCallBack callBack
)

设置推送昵称

Parameters:

  • nickname 推送昵称
  • callBack [BMXErrorCode]

Example:

public void setPushNickname(String nickname, BMXCallBack callBack) {
    mService.setPushNickname(nickname, callBack);

function setPushAlias

inline void setPushAlias(
    final String alias,
    final String bmxPushToken,
    final BMXCallBack callBack
)

设置推送别名

Parameters:

  • alias 别名
  • bmxPushToken 推送token
  • callBack [BMXErrorCode]

Example:

function setNotificationSound

inline void setNotificationSound(
    final boolean enable,
    final BMXCallBack callBack
)

设置收到新消息是否声音提醒

Parameters:

  • enable 收到新消息是否声音提醒,true提醒,false不提醒
  • callBack [BMXErrorCode]

Example:

public void setNotificationSound(boolean enable, BMXCallBack callBack) {
    mService.setNotificationSound(enable, callBack);

function setNotificationVibrate

inline void setNotificationVibrate(
    final boolean enable,
    final BMXCallBack callBack
)

设置收到新消息是否震动

Parameters:

  • enable 收到新消息是否震动,true震动,false不震动
  • callBack [BMXErrorCode]

Example:

public void setNotificationVibrate(boolean enable, BMXCallBack callBack) {
    mService.setNotificationVibrate(enable, callBack);

function setAutoDownloadAttachment

inline void setAutoDownloadAttachment(
    final boolean enable,
    final BMXCallBack callBack
)

设置是否自动缩略图和语音附件

Parameters:

  • enable 是否自动缩略图和语音附件,true自动下载,false不会自动下载
  • callBack [BMXErrorCode]

Example:

public void setAutoDownloadAttachment(boolean enable, BMXCallBack callBack) {
    mService.setAutoDownloadAttachment(enable, callBack);

function setAutoAcceptGroupInvite

inline void setAutoAcceptGroupInvite(
    final boolean enable,
    final BMXCallBack callBack
)

设置是否自动同意入群邀请

Parameters:

  • enable 是否自动同意入群邀请,true同意,false不同意
  • callBack [BMXErrorCode]

Example:

public void setAutoAcceptGroupInvite(boolean enable, BMXCallBack callBack) {
    mService.setAutoAcceptGroupInvite(enable, callBack);

function addUserListener

inline void addUserListener(
    BMXUserServiceListener listener
)

添加用户状态监听者

Parameters:

  • listener 用户状态监听者

Example:

public void addUserListener(BMXUserServiceListener listener) {
    mService.addUserListener(listener);

function removeUserListener

inline void removeUserListener(
    BMXUserServiceListener listener
)

移除用户状态监听者

Parameters:

  • listener 用户状态监听者

Example:

public void removeUserListener(BMXUserServiceListener listener) {
    mService.removeUserListener(listener);

function changeAppId

inline void changeAppId(
    final String appId,
    final BMXCallBack callBack
)

切换appId

Parameters:

  • appId appId

Example:

public void changeAppId(String appId, BMXCallBack callBack) {
    mService.changeAppId(appId, callBack);


Updated on 2022-01-26 at 17:18:31 +0800

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

results matching ""

    No results matching ""