藍鶯開發者
Web & Mini ProgramiOSAndroidC++Server API

BMXClient Class Reference#

Inherits from BMXNetworkListener :
NSObject
Declared in floo_proxy.h

Overview#

@interface 客戶端實例

Properties#

chatService#

@property (nonatomic, strong, readonly) BMXChatService *chatService

groupService#

@property (nonatomic, strong, readonly) BMXGroupService *groupService

pushService#

@property (nonatomic, strong, readonly) BMXPushService *pushService

rosterService#

@property (nonatomic, strong, readonly) BMXRosterService *rosterService

rtcService#

@property (nonatomic, strong, readonly) BMXRTCService *rtcService

userService#

@property (nonatomic, strong, readonly) BMXUserService *userService

Class Methods#

createWithConfig:#

建立BMXClient

+ (BMXClient )createWithConfig:(BMXSDKConfig )config

Parameters#

config
客戶端本地已經建立好的BMXSDKConfig SDK配置物件

Return Value#

BMXClient

Declared In#

  • floo_proxy.h


Example:

{% lanying_code_snippet repo="lanying-im-ios",class="BMXClient",function="createWithConfig:" %}{% endlanying_code_snippet %}

sharedClient#

+ (instancetype)sharedClient

Instance Methods#


Example:

{% lanying_code_snippet repo="lanying-im-ios",class="BMXClient",function="sharedClient" %}{% endlanying_code_snippet %}

changeAppIdWithAppId:#

- (BMXErrorCode)changeAppIdWithAppId:(NSString )appId*


Example:

{% lanying_code_snippet repo="lanying-im-ios",class="BMXClient",function="changeAppIdWithAppId:" %}{% endlanying_code_snippet %}

changeAppIdWithAppId:appSecret:#

更改SDK的appId,本操作會同時更新BMXConfig中的appId。

- (BMXErrorCode)changeAppIdWithAppId:(NSString )appId appSecret:(NSString )appSecret

Parameters#

appId
新變更的appId

Return Value#

BMXErrorCode

Declared In#

  • floo_proxy.h


Example:

{% lanying_code_snippet repo="lanying-im-ios",class="BMXClient",function="changeAppIdWithAppId:appSecret:" %}{% endlanying_code_snippet %}

changeAppIdWithAppId:appSecret:completion:#

更改SDK的appId,本操作會同時更新BMXConfig中的appId。

- (void)changeAppIdWithAppId:(NSString )appId appSecret:(NSString )appSecret completion:(void ( ^ ) ( BMXError aError ))resBlock*

Parameters#

appId
新變更的appId

Return Value#

BMXErrorCode

Declared In#

  • floo_proxy.h


Example:

{% lanying_code_snippet repo="lanying-im-ios",class="BMXClient",function="changeAppIdWithAppId:appSecret:completion:" %}{% endlanying_code_snippet %}

changeAppIdWithAppId:completion:#

- (void)changeAppIdWithAppId:(NSString )appId completion:(void ( ^ ) ( BMXError aError ))resBlock


Example:

{% lanying_code_snippet repo="lanying-im-ios",class="BMXClient",function="changeAppIdWithAppId:completion:" %}{% endlanying_code_snippet %}

connectStatus#

取得當前和伺服器的連接狀態

- (BMXConnectStatus)connectStatus

Return Value#

BMXConnectStatus

Declared In#

  • floo_proxy.h


Example:

{% lanying_code_snippet repo="lanying-im-ios",class="BMXClient",function="connectStatus" %}{% endlanying_code_snippet %}

dealloc#

- (void)dealloc


Example:

{% lanying_code_snippet repo="lanying-im-ios",class="BMXClient",function="dealloc" %}{% endlanying_code_snippet %}

deleteAccountWithPassword:#

刪除賬號

- (BMXErrorCode)deleteAccountWithPassword:(NSString )password*

Parameters#

password
密碼

Return Value#

BMXErrorCode

Declared In#

  • floo_proxy.h


Example:

{% lanying_code_snippet repo="lanying-im-ios",class="BMXClient",function="deleteAccountWithPassword:" %}{% endlanying_code_snippet %}

deleteAccountWithPassword:completion:#

刪除賬號

- (void)deleteAccountWithPassword:(NSString )password completion:(void ( ^ ) ( BMXError aError ))resBlock

Parameters#

password
密碼

Return Value#

BMXErrorCode

Declared In#

  • floo_proxy.h


Example:

{% lanying_code_snippet repo="lanying-im-ios",class="BMXClient",function="deleteAccountWithPassword:completion:" %}{% endlanying_code_snippet %}

disconnect#

斷開網路連接

- (void)disconnect

Declared In#

  • floo_proxy.h


Example:

{% lanying_code_snippet repo="lanying-im-ios",class="BMXClient",function="disconnect" %}{% endlanying_code_snippet %}

disconnectWithCompletion:#

斷開網路連接

- (void)disconnectWithCompletion:(void ( ^ ) ( BMXError aError ))resBlock*

Declared In#

  • floo_proxy.h


Example:

{% lanying_code_snippet repo="lanying-im-ios",class="BMXClient",function="disconnectWithCompletion:" %}{% endlanying_code_snippet %}

fastSignInByIdWithUid:password:#

通過使用者ID快速登入(要求之前成功登入過,登入速度較快)

- (BMXErrorCode)fastSignInByIdWithUid:(long long)uid password:(NSString )password*

Parameters#

uid
使用者id

password
使用者密碼(用於sdk在內部token到期時自動更新使用者token)

Return Value#

BMXErrorCode

Declared In#

  • floo_proxy.h


Example:

{% lanying_code_snippet repo="lanying-im-ios",class="BMXClient",function="fastSignInByIdWithUid:password:" %}{% endlanying_code_snippet %}

fastSignInByIdWithUid:password:completion:#

通過使用者ID快速登入(要求之前成功登入過,登入速度較快)

- (void)fastSignInByIdWithUid:(long long)uid password:(NSString )password completion:(void ( ^ ) ( BMXError aError ))resBlock

Parameters#

uid
使用者id

password
使用者密碼(用於sdk在內部token到期時自動更新使用者token)

Return Value#

BMXErrorCode

Declared In#

  • floo_proxy.h


Example:

{% lanying_code_snippet repo="lanying-im-ios",class="BMXClient",function="fastSignInByIdWithUid:password:completion:" %}{% endlanying_code_snippet %}

fastSignInByNameWithName:password:#

通過使用者名快速登入(要求之前成功登入過,登入速度較快)

- (BMXErrorCode)fastSignInByNameWithName:(NSString )name password:(NSString )password

Parameters#

name
使用者名

password
使用者密碼(用於sdk在內部token到期時自動更新使用者token)

Return Value#

BMXErrorCode

Declared In#

  • floo_proxy.h


Example:

{% lanying_code_snippet repo="lanying-im-ios",class="BMXClient",function="fastSignInByNameWithName:password:" %}{% endlanying_code_snippet %}

fastSignInByNameWithName:password:completion:#

通過使用者名快速登入(要求之前成功登入過,登入速度較快)

- (void)fastSignInByNameWithName:(NSString )name password:(NSString )password completion:(void ( ^ ) ( BMXError aError ))resBlock*

Parameters#

name
使用者名

password
使用者密碼(用於sdk在內部token到期時自動更新使用者token)

Return Value#

BMXErrorCode

Declared In#

  • floo_proxy.h


Example:

{% lanying_code_snippet repo="lanying-im-ios",class="BMXClient",function="fastSignInByNameWithName:password:completion:" %}{% endlanying_code_snippet %}

getSDKConfig#

取得SDK設定

- (BMXSDKConfig *)getSDKConfig

Return Value#

BMXSDKConfig

Declared In#

  • floo_proxy.h


Example:

{% lanying_code_snippet repo="lanying-im-ios",class="BMXClient",function="getSDKConfig" %}{% endlanying_code_snippet %}

initializeServerConfigWithIsLocal:#

取得app的伺服器網路配置,在初始化SDK之後登陸之前呼叫,可以提前取得伺服器配置加快登陸速度。

- (BMXErrorCode)initializeServerConfigWithIsLocal:(BOOL)isLocal

Parameters#

isLocal
為true則使用本地緩存的dns配置,為false則從伺服器取得最新的配置。

Return Value#

BMXErrorCode

Declared In#

  • floo_proxy.h


Example:

{% lanying_code_snippet repo="lanying-im-ios",class="BMXClient",function="initializeServerConfigWithIsLocal:" %}{% endlanying_code_snippet %}

initializeServerConfigWithIsLocal:completion:#

取得app的伺服器網路配置,在初始化SDK之後登陸之前呼叫,可以提前取得伺服器配置加快登陸速度。

- (void)initializeServerConfigWithIsLocal:(BOOL)isLocal completion:(void ( ^ ) ( BMXError aError ))resBlock*

Parameters#

isLocal
為true則使用本地緩存的dns配置,為false則從伺服器取得最新的配置。

Return Value#

BMXErrorCode

Declared In#

  • floo_proxy.h


Example:

{% lanying_code_snippet repo="lanying-im-ios",class="BMXClient",function="initializeServerConfigWithIsLocal:completion:" %}{% endlanying_code_snippet %}

onNetworkChangedWithType:reconnect:#

處理網路狀態發送變化

- (void)onNetworkChangedWithType:(BMXNetworkType)type reconnect:(BOOL)reconnect

Parameters#

type
變化後的網路類型

reconnect
網路是否需要重連

Declared In#

  • floo_proxy.h


Example:

{% lanying_code_snippet repo="lanying-im-ios",class="BMXClient",function="onNetworkChangedWithType:reconnect:" %}{% endlanying_code_snippet %}

reconnect#

強制重新連接

- (void)reconnect

Declared In#

  • floo_proxy.h


Example:

{% lanying_code_snippet repo="lanying-im-ios",class="BMXClient",function="reconnect" %}{% endlanying_code_snippet %}

reconnectWithCompletion:#

強制重新連接

- (void)reconnectWithCompletion:(void ( ^ ) ( BMXError aError ))resBlock*

Declared In#

  • floo_proxy.h


Example:

{% lanying_code_snippet repo="lanying-im-ios",class="BMXClient",function="reconnectWithCompletion:" %}{% endlanying_code_snippet %}

sendMessageWithMsg:#

發送訊息,訊息狀態變化會通過listener通知,在發送群組訊息且指定的群組為開啟群組已讀回執的情況下,
該介面會自動取得群成員列表id並且填充到message config中去,無需客戶端自己進行群組成員列表的填充操作。

- (void)sendMessageWithMsg:(BMXMessage )msg*

Parameters#

msg
發送的訊息

Declared In#

  • floo_proxy.h


Example:

{% lanying_code_snippet repo="lanying-im-ios",class="BMXClient",function="sendMessageWithMsg:" %}{% endlanying_code_snippet %}

sendMessageWithMsg:completion:#

發送訊息,訊息狀態變化會通過listener通知,在發送群組訊息且指定的群組為開啟群組已讀回執的情況下,
該介面會自動取得群成員列表id並且填充到message config中去,無需客戶端自己進行群組成員列表的填充操作。

- (void)sendMessageWithMsg:(BMXMessage )msg completion:(void ( ^ ) ( BMXError aError ))resBlock

Parameters#

msg
發送的訊息

Declared In#

  • floo_proxy.h


Example:

{% lanying_code_snippet repo="lanying-im-ios",class="BMXClient",function="sendMessageWithMsg:completion:" %}{% endlanying_code_snippet %}

signInByIdWithArg1:password:#

通過使用者名登入

- (BMXErrorCode)signInByIdWithArg1:(long long)arg1 password:(NSString )password*

Parameters#

password
使用者密碼

name
使用者名

Return Value#

BMXErrorCode

Declared In#

  • floo_proxy.h


Example:

{% lanying_code_snippet repo="lanying-im-ios",class="BMXClient",function="signInByIdWithArg1:password:" %}{% endlanying_code_snippet %}

signInByIdWithArg1:password:completion:#

通過使用者ID登入

- (void)signInByIdWithArg1:(long long)arg1 password:(NSString )password completion:(void ( ^ ) ( BMXError aError ))resBlock

Parameters#

password
使用者密碼

int64_t
使用者id

Return Value#

BMXErrorCode

Declared In#

  • floo_proxy.h


Example:

{% lanying_code_snippet repo="lanying-im-ios",class="BMXClient",function="signInByIdWithArg1:password:completion:" %}{% endlanying_code_snippet %}

signInByNameWithName:password:#

通過使用者名登入

- (BMXErrorCode)signInByNameWithName:(NSString )name password:(NSString )password

Parameters#

name
使用者名

password
使用者密碼

Return Value#

BMXErrorCode

Declared In#

  • floo_proxy.h


Example:

{% lanying_code_snippet repo="lanying-im-ios",class="BMXClient",function="signInByNameWithName:password:" %}{% endlanying_code_snippet %}

signInByNameWithName:password:completion:#

通過使用者名登入

- (void)signInByNameWithName:(NSString )name password:(NSString )password completion:(void ( ^ ) ( BMXError aError ))resBlock*

Parameters#

name
使用者名

password
使用者密碼

Return Value#

BMXErrorCode

Declared In#

  • floo_proxy.h


Example:

{% lanying_code_snippet repo="lanying-im-ios",class="BMXClient",function="signInByNameWithName:password:completion:" %}{% endlanying_code_snippet %}

signInStatus#

取得當前的登入狀態

- (BMXSignInStatus)signInStatus

Return Value#

BMXSignInStatus

Declared In#

  • floo_proxy.h


Example:

{% lanying_code_snippet repo="lanying-im-ios",class="BMXClient",function="signInStatus" %}{% endlanying_code_snippet %}

signOut#

- (BMXErrorCode)signOut


Example:

{% lanying_code_snippet repo="lanying-im-ios",class="BMXClient",function="signOut" %}{% endlanying_code_snippet %}

signOutWithCompletion:#

- (void)signOutWithCompletion:(void ( ^ ) ( BMXError aError ))resBlock*


Example:

{% lanying_code_snippet repo="lanying-im-ios",class="BMXClient",function="signOutWithCompletion:" %}{% endlanying_code_snippet %}

signOutWithUid:#

- (BMXErrorCode)signOutWithUid:(long long)uid


Example:

{% lanying_code_snippet repo="lanying-im-ios",class="BMXClient",function="signOutWithUid:" %}{% endlanying_code_snippet %}

signOutWithUid:completion:#

- (void)signOutWithUid:(long long)uid completion:(void ( ^ ) ( BMXError aError ))resBlock*


Example:

{% lanying_code_snippet repo="lanying-im-ios",class="BMXClient",function="signOutWithUid:completion:" %}{% endlanying_code_snippet %}

signOutWithUid:ignoreUnbindDevice:#

退出登入

- (BMXErrorCode)signOutWithUid:(long long)uid ignoreUnbindDevice:(BOOL)ignoreUnbindDevice

Parameters#

uid
退出使用者的uid(預設輸入0則退出當前登陸使用者)

ignoreUnbindDevice
使用者退出時是否忽略解綁定設備操作。對應某些伺服器不可訪問的情況下忽略伺服器解綁定設備操作直接強制退出時設定為true

Return Value#

BMXErrorCode

Declared In#

  • floo_proxy.h


Example:

{% lanying_code_snippet repo="lanying-im-ios",class="BMXClient",function="signOutWithUid:ignoreUnbindDevice:" %}{% endlanying_code_snippet %}

signOutWithUid:ignoreUnbindDevice:completion:#

退出登入

- (void)signOutWithUid:(long long)uid ignoreUnbindDevice:(BOOL)ignoreUnbindDevice completion:(void ( ^ ) ( BMXError aError ))resBlock*

Parameters#

uid
退出使用者的uid(預設輸入0則退出當前登陸使用者)

ignoreUnbindDevice
使用者退出時是否忽略解綁定設備操作。對應某些伺服器不可訪問的情況下忽略伺服器解綁定設備操作直接強制退出時設定為true

Return Value#

BMXErrorCode

Declared In#

  • floo_proxy.h


Example:

{% lanying_code_snippet repo="lanying-im-ios",class="BMXClient",function="signOutWithUid:ignoreUnbindDevice:completion:" %}{% endlanying_code_snippet %}

signUpNewUserWithUsername:password:bmxUserProfilePtr:#

註冊新使用者,username和password是必填參數

- (BMXErrorCode)signUpNewUserWithUsername:(NSString )username password:(NSString )password bmxUserProfilePtr:(BMXUserProfile )bmxUserProfilePtr*

Parameters#

username
使用者名

password
使用者密碼

bmxUserProfilePtr
註冊成功後從該函數處取得新註冊使用者的Profile信息,初始傳入指向為空的shared_ptr物件即可。

Return Value#

BMXErrorCode

Declared In#

  • floo_proxy.h


Example:

{% lanying_code_snippet repo="lanying-im-ios",class="BMXClient",function="signUpNewUserWithUsername:password:bmxUserProfilePtr:" %}{% endlanying_code_snippet %}

signUpNewUserWithUsername:password:completion:#

註冊新使用者,username和password是必填參數

- (void)signUpNewUserWithUsername:(NSString )username password:(NSString )password completion:(void ( ^ ) ( BMXUserProfile profile , BMXError aError ))resBlock

Parameters#

username
使用者名

password
使用者密碼

bmxUserProfilePtr
註冊成功後從該函數處取得新註冊使用者的Profile信息,初始傳入指向為空的shared_ptr物件即可。

Return Value#

BMXErrorCode

Declared In#

  • floo_proxy.h

Example:

{% lanying_code_snippet repo="lanying-im-ios",class="BMXClient",function="signUpNewUserWithUsername:password:completion:" %}{% endlanying_code_snippet %}
自動產生的 API 內容,僅在必要位置補充精簡的 AI 解說。