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