human: 如何处理七牛云的即时通讯BMXUserManager

gpt: [即时通讯](https://developer.qiniu.com/IM) > API 文档 > [ANDROID
API](https://developer.qiniu.com/IM/api/8191/android-im-class-indexes) >
BMXUserManager

#  BMXUserManager

最近更新时间: 2022-07-22 22:42:26

class im.floo.floolib.BMXUserManager

用户管理器

Index

方法

  * signUpNewUser
  * signInByName
  * signInById
  * autoSignInByName
  * autoSignInById
  * signOut
  * signOut
  * connectStatus
  * signInStatus
  * bindDevice
  * getDeviceList
  * deleteDevice
  * getProfile
  * setNickname
  * uploadAvatar
  * downloadAvatar
  * setPublicInfo
  * setPrivateInfo
  * setAddFriendAuthMode
  * setAuthQuestion
  * setEnablePush
  * setEnablePushDetaile
  * setPushNickname
  * setPushAlias
  * setNotificationSound
  * setNotificationVibrate
  * setAutoDownloadAttachment
  * setAutoAcceptGroupInvite
  * addUserListener
  * removeUserListener
  * changeAppId

方法

signUpNewUser

  * public void signUpNewUser(final String username, final String password, final BMXDataCallBack<BMXUserProfile> callBack);
  * 注册

Parameters

    * password: String 

密码

    * username: String 

用户名

    * callBack: <any>

BMXUserProfile

Returns void

signInByName

  * public void signInByName(final String name, final String password, final BMXCallBack callBack);
  * 用户名登陆

Parameters

    * name: String 

    * password: String 

    * callBack: BMXCallBack 

BMXErrorCode

Returns void

signInById

  * public void signInById(final long id, final String password, final BMXCallBack callBack);
  * id 登陆

Parameters

    * id: long 

    * password: String 

    * callBack: BMXCallBack 

BMXErrorCode

Returns void

autoSignInByName

  * public void autoSignInByName(final String name, final String password, final BMXCallBack callBack);
  * 自动登陆 根据用户名

Parameters

    * name: String 

    * password: String 

    * callBack: BMXCallBack 

BMXErrorCode

Returns void

autoSignInById

  * public void autoSignInById(final long uid, final String password, final BMXCallBack callBack);
  * 自动登陆 根据id

Parameters

    * uid: long 

    * password: String 

    * callBack: BMXCallBack 

BMXErrorCode

Returns void

signOut

  * public void signOut(final BMXCallBack callBack);
  * 退出登录

Parameters

    * callBack: BMXCallBack 

BMXErrorCode

Returns void

signOut

  * public void signOut(final long userId, final BMXCallBack callBack);
  * 退出登录

Parameters

    * callBack: long 

BMXErrorCode

Returns void

connectStatus

  * public BMXConnectStatus connectStatus();
  * 获取当前和服务器的连接状态

Returns
[BMXConnectStatus](https://developer.qiniu.com/IM/api/8202/bmxconnectstatus)

signInStatus

  * public BMXSignInStatus signInStatus();
  * 获取当前的登录状态

Returns
[BMXSignInStatus](https://developer.qiniu.com/IM/api/8286/bmxsigninstatus)

bindDevice

  * public void bindDevice(final String token, final BMXCallBack callBack);
  * 绑定设备推送token

Parameters

    * token: String 

device token

    * callBack: BMXCallBack 

BMXErrorCode

Returns void

getDeviceList

  * public void getDeviceList(final BMXDataCallBack<BMXDeviceList> callBack);
  * 获取登录的设备列表

Parameters

    * callBack: <any>

BMXErrorCode 登录的设备列表

Returns void

deleteDevice

  * public void deleteDevice(final int device_sn, final BMXCallBack callBack);
  * 删除设备

Parameters

    * callBack: int 

BMXErrorCode

Returns void

getProfile

  * public void getProfile(final boolean forceRefresh, final BMXDataCallBack<BMXUserProfile> callBack);
  * 获取用户详情

Parameters

    * forceRefresh: boolean 

强制从服务器拉取最新结果

    * callBack: <any>

BMXErrorCode,用户详情

Returns void

setNickname

  * public void setNickname(final String nickname, final BMXCallBack callBack);
  * 设置昵称

Parameters

    * nickname: String 

昵称

    * callBack: BMXCallBack 

BMXErrorCode

Returns void

uploadAvatar

  * public void uploadAvatar(final String avatarPath, final FileProgressListener listener, final BMXCallBack callBack);
  * 上传头像

Parameters

    * avatarPath: String 

头像本地文件路径

    * listener: FileProgressListener 

上传进度监听器

    * callBack: BMXCallBack 

BMXErrorCode

Returns void

downloadAvatar

  * public void downloadAvatar(final BMXUserProfile profile, final FileProgressListener listener, final BMXCallBack callBack);
  * 下载头像

Parameters

    * profile: [BMXUserProfile](https://developer.qiniu.com/IM/api/8304/bmxuserprofile)

用户详情

    * listener: FileProgressListener 

下载进度监听器

    * callBack: BMXCallBack 

BMXErrorCode

Returns void

setPublicInfo

  * public void setPublicInfo(final String publicInfo, final BMXCallBack callBack);
  * 设置公开扩展信息

Parameters

    * publicInfo: String 

用户公开信息

    * callBack: BMXCallBack 

BMXErrorCode

Returns void

setPrivateInfo

  * public void setPrivateInfo(final String privateInfo, final BMXCallBack callBack);
  * 设置私有扩展信息

Parameters

    * privateInfo: String 

用户私有信息（只对自己可见）

    * callBack: BMXCallBack 

BMXErrorCode

Returns void

setAddFriendAuthMode

  * public void setAddFriendAuthMode(final BMXUserProfile.AddFriendAuthMode mode, final BMXCallBack callBack);
  * 设置加好友验证方式

Parameters

    * mode: AddFriendAuthMode 

添加好友时的验证方式

    * callBack: BMXCallBack 

BMXErrorCode

Returns void

setAuthQuestion

  * public void setAuthQuestion(final BMXUserProfile.AuthQuestion authQuestion, final BMXCallBack callBack);
  * 设置加好友验证问题

Parameters

    * authQuestion: AuthQuestion 

验证问题

    * callBack: BMXCallBack 

BMXErrorCode

Returns void

setEnablePush

  * public void setEnablePush(final boolean enable, final BMXCallBack callBack);
  * 设置是否允许推送

Parameters

    * enable: boolean 

是否允许推送，true推送，false不推送

    * callBack: BMXCallBack 

BMXErrorCode

Returns void

setEnablePushDetaile

  * public void setEnablePushDetaile(final boolean enable, final BMXCallBack callBack);
  * 设置是否推送详情

Parameters

    * enable: boolean 

是否推送详情，true推送，false不推送

    * callBack: BMXCallBack 

BMXErrorCode

Returns void

setPushNickname

  * public void setPushNickname(final String nickname, final BMXCallBack callBack);
  * 设置推送昵称

Parameters

    * nickname: String 

推送昵称

    * callBack: BMXCallBack 

BMXErrorCode

Returns void

setPushAlias

  * public void setPushAlias(final String alias, final String bmxPushToken, final BMXCallBack callBack);
  * 设置推送别名

Parameters

    * alias: String 

别名

    * bmxPushToken: String 

推送token

    * callBack: BMXCallBack 

BMXErrorCode

Returns void

setNotificationSound

  * public void setNotificationSound(final boolean enable, final BMXCallBack callBack);
  * 设置收到新消息是否声音提醒

Parameters

    * enable: boolean 

收到新消息是否声音提醒，true提醒，false不提醒

    * callBack: BMXCallBack 

BMXErrorCode

Returns void

setNotificationVibrate

  * public void setNotificationVibrate(final boolean enable, final BMXCallBack callBack);
  * 设置收到新消息是否震动

Parameters

    * enable: boolean 

收到新消息是否震动，true震动，false不震动

    * callBack: BMXCallBack 

BMXErrorCode

Returns void

setAutoDownloadAttachment

  * public void setAutoDownloadAttachment(final boolean enable, final BMXCallBack callBack);
  * 设置是否自动缩略图和语音附件

Parameters

    * enable: boolean 

是否自动缩略图和语音附件，true自动下载，false不会自动下载

    * callBack: BMXCallBack 

BMXErrorCode

Returns void

setAutoAcceptGroupInvite

  * public void setAutoAcceptGroupInvite(final boolean enable, final BMXCallBack callBack);
  * 设置是否自动同意入群邀请

Parameters

    * enable: boolean 

是否自动同意入群邀请，true同意，false不同意

    * callBack: BMXCallBack 

BMXErrorCode

Returns void

addUserListener

  * public void addUserListener(BMXUserServiceListener listener);
  * 添加用户状态监听者

Parameters

    * listener: [BMXUserServiceListener](https://developer.qiniu.com/IM/api/8293/bmxuserservicelistener)

用户状态监听者

Returns void

removeUserListener

  * public void removeUserListener(BMXUserServiceListener listener);
  * 移除用户状态监听者

Parameters

    * listener: [BMXUserServiceListener](https://developer.qiniu.com/IM/api/8293/bmxuserservicelistener)

用户状态监听者

Returns void

changeAppId

  * public void changeAppId(final String appId, final BMXCallBack callBack);
  * 切换appId

Parameters

    * appId: String 

appId

Returns void

以上内容是否对您有帮助？