im::floo::floolib::BMXClient#
客户端
Inherits from im.floo.floolib.BMXNetworkListener
Public Functions#
| Name | |
|---|---|
| synchronized void | delete() |
| BMXSDKConfig | getSDKConfig() 获取SDK设置 |
| BMXUserService | getUserService() 获取用户Service |
| BMXChatService | getChatService() 获取聊天Service |
| BMXGroupService | getGroupService() 获取群组Service |
| BMXRosterService | getRosterService() 获取好友Service |
| BMXPushService | getPushService() 获取推送Service |
| BMXUserManager | getUserManager() 获取用户Manager |
| BMXChatManager | getChatManager() 获取聊天Manager |
| BMXGroupManager | getGroupManager() 获取群组Manager |
| BMXRosterManager | getRosterManager() 获取好友Manager |
| BMXPushManager | getPushManager() 获取推送Manager |
| [BMXErrorCode] | signUpNewUser(String username, String password, BMXUserProfile bmxUserProfilePtr) 注册新用户,username和password是必填参数 |
| [BMXErrorCode] | signInByName(String name, String password) 通过用户名登录 |
| [BMXErrorCode] | signInById(long arg0, String password) 通过用户ID登录 |
| [BMXErrorCode] | fastSignInByName(String name, String password) 通过用户名快速登录(要求之前成功登录过,登录速度较快) |
| [BMXErrorCode] | fastSignInById(long uid, String password) 通过用户ID快速登录(要求之前成功登录过,登录速度较快) |
| [BMXErrorCode] | signOut(long uid, boolean ignoreUnbindDevice) 退出登录 |
| [BMXErrorCode] | signOut(long uid) |
| [BMXErrorCode] | signOut() |
| [BMXConnectStatus] | connectStatus() 获取当前和服务器的连接状态 |
| [BMXSignInStatus] | signInStatus() 获取当前的登录状态 |
| void | reconnect() 强制重新连接 |
| void | onNetworkChanged([BMXNetworkType] type, boolean reconnect) 处理网络状态发送变化 |
| void | disconnect() 断开网络连接 |
| [BMXErrorCode] | changeAppId(String appId, String appSecret) 更改SDK的appId,本操作会同时更新BMXConfig中的appId。 |
| [BMXErrorCode] | changeAppId(String appId) 更改SDK的appId,本操作会同时更新BMXConfig中的appId。 |
| [BMXErrorCode] | initializeServerConfig(boolean isLocal) 获取app的服务器网络配置,在初始化SDK之后登陆之前调用,可以提前获取服务器配置加快登陆速度。 |
| void | sendMessage(BMXMessage msg) 发送消息,消息状态变化会通过listener通知,在发送群组消息且指定的群组为开启群组已读回执的情况下, 该接口会自动获取群成员列表id并且填充到message config中去,无需客户端自己进行群组成员列表的填充操作。 |
| BMXClient | create(BMXSDKConfig config) 创建BMXClient |
Protected Functions#
Additional inherited members#
Public Functions inherited from im.floo.floolib.BMXNetworkListener
| Name | |
|---|---|
| void | swigReleaseOwnership() |
| void | swigTakeOwnership() |
| BMXNetworkListener() |
Protected Functions inherited from im.floo.floolib.BMXNetworkListener
| Name | |
|---|---|
| BMXNetworkListener(long cPtr, boolean cMemoryOwn) | |
| void | swigDirectorDisconnect() |
Public Functions Documentation#
function delete#
inline synchronized void delete()
Reimplements: im::floo::floolib::BMXNetworkListener::delete
Example:
{% lanying_code_snippet repo="lanying-im-android",class="BMXClient",function="delete" %}{% endlanying_code_snippet %}
function getSDKConfig#
inline BMXSDKConfig getSDKConfig()
获取SDK设置
Return: BMXSDKConfigPtr
Example:
{% lanying_code_snippet repo="lanying-im-android",class="BMXClient",function="getSDKConfig" %}{% endlanying_code_snippet %}
function getUserService#
inline BMXUserService getUserService()
获取用户Service
Return: BMXUserService
Example:
{% lanying_code_snippet repo="lanying-im-android",class="BMXClient",function="getUserService" %}{% endlanying_code_snippet %}
function getChatService#
inline BMXChatService getChatService()
获取聊天Service
Return: BMXChatService
Example:
{% lanying_code_snippet repo="lanying-im-android",class="BMXClient",function="getChatService" %}{% endlanying_code_snippet %}
function getGroupService#
inline BMXGroupService getGroupService()
获取群组Service
Return: BMXGroupService
Example:
{% lanying_code_snippet repo="lanying-im-android",class="BMXClient",function="getGroupService" %}{% endlanying_code_snippet %}
function getRosterService#
inline BMXRosterService getRosterService()
获取好友Service
Return: BMXRosterService
Example:
{% lanying_code_snippet repo="lanying-im-android",class="BMXClient",function="getRosterService" %}{% endlanying_code_snippet %}
function getPushService#
inline BMXPushService getPushService()
获取推送Service
Return: BMXPushService
Example:
{% lanying_code_snippet repo="lanying-im-android",class="BMXClient",function="getPushService" %}{% endlanying_code_snippet %}
function getUserManager#
inline BMXUserManager getUserManager()
获取用户Manager
Return: BMXUserManager
Example:
{% lanying_code_snippet repo="lanying-im-android",class="BMXClient",function="getUserManager" %}{% endlanying_code_snippet %}
function getChatManager#
inline BMXChatManager getChatManager()
获取聊天Manager
Return: BMXChatManager
Example:
{% lanying_code_snippet repo="lanying-im-android",class="BMXClient",function="getChatManager" %}{% endlanying_code_snippet %}
function getGroupManager#
inline BMXGroupManager getGroupManager()
获取群组Manager
Return: BMXGroupManager
Example:
{% lanying_code_snippet repo="lanying-im-android",class="BMXClient",function="getGroupManager" %}{% endlanying_code_snippet %}
function getRosterManager#
inline BMXRosterManager getRosterManager()
获取好友Manager
Return: BMXRosterManager
Example:
{% lanying_code_snippet repo="lanying-im-android",class="BMXClient",function="getRosterManager" %}{% endlanying_code_snippet %}
function getPushManager#
inline BMXPushManager getPushManager()
获取推送Manager
Return: BMXPushManager
Example:
{% lanying_code_snippet repo="lanying-im-android",class="BMXClient",function="getPushManager" %}{% endlanying_code_snippet %}
function signUpNewUser#
inline BMXErrorCode signUpNewUser(
String username,
String password,
BMXUserProfile bmxUserProfilePtr
)
注册新用户,username和password是必填参数
Parameters:
- username 用户名
- password 用户密码
- bmxUserProfilePtr 注册成功后从该函数处获取新注册用户的Profile信息,初始传入指向为空的shared_ptr对象即可。
Return: [BMXErrorCode]
Example:
{% lanying_code_snippet repo="lanying-im-android",class="BMXClient",function="signUpNewUser" %}{% endlanying_code_snippet %}
function signInByName#
inline BMXErrorCode signInByName(
String name,
String password
)
通过用户名登录
Parameters:
- name 用户名
- password 用户密码
Return: [BMXErrorCode]
Example:
{% lanying_code_snippet repo="lanying-im-android",class="BMXClient",function="signInByName" %}{% endlanying_code_snippet %}
function signInById#
inline BMXErrorCode signInById(
long arg0,
String password
)
通过用户ID登录
Parameters:
- arg0 用户id
- password 用户密码
Return: [BMXErrorCode]
Example:
{% lanying_code_snippet repo="lanying-im-android",class="BMXClient",function="signInById" %}{% endlanying_code_snippet %}
function fastSignInByName#
inline BMXErrorCode fastSignInByName(
String name,
String password
)
通过用户名快速登录(要求之前成功登录过,登录速度较快)
Parameters:
- name 用户名
- password 用户密码(用于sdk在内部token到期时自动更新用户token)
Return: [BMXErrorCode]
Example:
{% lanying_code_snippet repo="lanying-im-android",class="BMXClient",function="fastSignInByName" %}{% endlanying_code_snippet %}
function fastSignInById#
inline BMXErrorCode fastSignInById(
long uid,
String password
)
通过用户ID快速登录(要求之前成功登录过,登录速度较快)
Parameters:
- uid 用户id
- password 用户密码(用于sdk在内部token到期时自动更新用户token)
Return: [BMXErrorCode]
Example:
{% lanying_code_snippet repo="lanying-im-android",class="BMXClient",function="fastSignInById" %}{% endlanying_code_snippet %}
function signOut#
inline BMXErrorCode signOut(
long uid,
boolean ignoreUnbindDevice
)
退出登录
Parameters:
- uid 退出用户的uid(默认输入0则退出当前登陆用户)
- ignoreUnbindDevice 用户退出时是否忽略解绑定设备操作。对应某些服务器不可访问的情况下忽略服务器解绑定设备操作直接强制退出时设置为true
Return: [BMXErrorCode]
Example:
{% lanying_code_snippet repo="lanying-im-android",class="BMXClient",function="signOut" %}{% endlanying_code_snippet %}
function signOut#
inline BMXErrorCode signOut(
long uid
)
Example:
{% lanying_code_snippet repo="lanying-im-android",class="BMXClient",function="signOut" %}{% endlanying_code_snippet %}
function signOut#
inline BMXErrorCode signOut()
Example:
{% lanying_code_snippet repo="lanying-im-android",class="BMXClient",function="signOut" %}{% endlanying_code_snippet %}
function connectStatus#
inline BMXConnectStatus connectStatus()
获取当前和服务器的连接状态
Return: [BMXConnectStatus]
Example:
{% lanying_code_snippet repo="lanying-im-android",class="BMXClient",function="connectStatus" %}{% endlanying_code_snippet %}
function signInStatus#
inline BMXSignInStatus signInStatus()
获取当前的登录状态
Return: [BMXSignInStatus]
Example:
{% lanying_code_snippet repo="lanying-im-android",class="BMXClient",function="signInStatus" %}{% endlanying_code_snippet %}
function reconnect#
inline void reconnect()
强制重新连接
Example:
{% lanying_code_snippet repo="lanying-im-android",class="BMXClient",function="reconnect" %}{% endlanying_code_snippet %}
function onNetworkChanged#
inline void onNetworkChanged(
BMXNetworkType type,
boolean reconnect
)
处理网络状态发送变化
Parameters:
- type 变化后的网络类型
- reconnect 网络是否需要重连
Reimplements: im::floo::floolib::BMXNetworkListener::onNetworkChanged
Example:
{% lanying_code_snippet repo="lanying-im-android",class="BMXClient",function="onNetworkChanged" %}{% endlanying_code_snippet %}
function disconnect#
inline void disconnect()
断开网络连接
Example:
{% lanying_code_snippet repo="lanying-im-android",class="BMXClient",function="disconnect" %}{% endlanying_code_snippet %}
function changeAppId#
inline BMXErrorCode changeAppId(
String appId,
String appSecret
)
更改SDK的appId,本操作会同时更新BMXConfig中的appId。
Parameters:
- appId 新变更的appId
- appSecret 新变更的appSecret
Example:
{% lanying_code_snippet repo="lanying-im-android",class="BMXClient",function="changeAppId" %}{% endlanying_code_snippet %}
function changeAppId#
inline BMXErrorCode changeAppId(
String appId
)
更改SDK的appId,本操作会同时更新BMXConfig中的appId。
Parameters:
- appId 新变更的appId
Example:
{% lanying_code_snippet repo="lanying-im-android",class="BMXClient",function="changeAppId" %}{% endlanying_code_snippet %}
function initializeServerConfig#
inline BMXErrorCode initializeServerConfig(
boolean isLocal
)
获取app的服务器网络配置,在初始化SDK之后登陆之前调用,可以提前获取服务器配置加快登陆速度。
Parameters:
- isLocal 为true则使用本地缓存的dns配置,为false则从服务器获取最新的配置。
Example:
{% lanying_code_snippet repo="lanying-im-android",class="BMXClient",function="initializeServerConfig" %}{% endlanying_code_snippet %}
function sendMessage#
inline void sendMessage(
BMXMessage msg
)
发送消息,消息状态变化会通过listener通知,在发送群组消息且指定的群组为开启群组已读回执的情况下, 该接口会自动获取群成员列表id并且填充到message config中去,无需客户端自己进行群组成员列表的填充操作。
Parameters:
- msg 发送的消息
Example:
{% lanying_code_snippet repo="lanying-im-android",class="BMXClient",function="sendMessage" %}{% endlanying_code_snippet %}
function create#
static inline BMXClient create(
BMXSDKConfig config
)
创建BMXClient
Parameters:
- config 客户端本地已经创建好的BMXSDKConfig SDK配置对象
Return: BMXClientPtr
Protected Functions Documentation#
Example:
{% lanying_code_snippet repo="lanying-im-android",class="BMXClient",function="create" %}{% endlanying_code_snippet %}
function BMXClient#
inline BMXClient(
long cPtr,
boolean cMemoryOwn
)
Example:
{% lanying_code_snippet repo="lanying-im-android",class="BMXClient",function="BMXClient" %}{% endlanying_code_snippet %}
function finalize#
inline void finalize()
Reimplements: im::floo::floolib::BMXNetworkListener::finalize
Example:
{% lanying_code_snippet repo="lanying-im-android",class="BMXClient",function="finalize" %}{% endlanying_code_snippet %}
function getCPtr#
static inline long getCPtr(
BMXClient obj
)
Example:
{% lanying_code_snippet repo="lanying-im-android",class="BMXClient",function="getCPtr" %}{% endlanying_code_snippet %}
Updated on 2022-01-26 at 17:18:31 +0800