LANYINGDevelopers
Web & Mini ProgramiOSAndroidC++Server API

floo::BMXClient#

Client

#include <bmx_client.h>

Inherits from floo::BMXNetworkListener

Public Functions#

Name
BMXClientPtrcreate(BMXSDKConfigPtr config)
Create BMXClient
virtual~BMXClient()
Destructor
virtual BMXSDKConfigPtrgetSDKConfig() =0
Get SDK settings
virtual BMXUserService &getUserService() =0
Get user Service
virtual BMXChatService &getChatService() =0
Get chat Service
virtual BMXGroupService &getGroupService() =0
Get group Service
virtual BMXRosterService &getRosterService() =0
Get roster Service
virtual BMXPushService &getPushService() =0
Get push Service
virtual BMXErrorCodesignUpNewUser(const std::string & username, const std::string & password, BMXUserProfilePtr & bmxUserProfilePtr) =0
To register a new user, username and password are required
virtual BMXErrorCodesignInByName(const std::string & name, const std::string & password) =0
Login by username
virtual BMXErrorCodesignInById(int64_t , const std::string & password) =0
Login by user ID
virtual BMXErrorCodefastSignInByName(const std::string & name, const std::string & password) =0
Quick login by username (requires a successful previous login, faster login)
virtual BMXErrorCodefastSignInById(int64_t uid, const std::string & password) =0
Quick login by user ID (requires a successful previous login, faster login)
virtual BMXErrorCodesignOut(int64_t uid =0, bool ignoreUnbindDevice =false) =0
Log out
virtual BMXConnectStatusconnectStatus() =0
Get the current connection state with server
virtual BMXSignInStatussignInStatus() =0
Get the current login state
virtual voidreconnect() =0
Force reconnection
virtual voidonNetworkChanged(BMXNetworkType type, bool reconnect) =0
Process network changes in messaging
virtual voiddisconnect() =0
Disconnect
virtual BMXErrorCodechangeAppId(const std::string & appId, const std::string & appSecret ="") =0
Change the appId of SDK, which also update the appId in BMXConfig.
virtual BMXErrorCodeinitializeServerConfig(bool isLocal) =0
Get the server network configuration of app, which can be called after initializing SDK and before logging in, so as to get the server configuration in advance and speed up logging in.
virtual voidsendMessage(BMXMessagePtr msg) =0
When send a message, the change of message status will be notified by listener. In the case of sending a group message in a specified group with group read acknowledgement enabled, the interface will automatically obtain the group member list id and fill it in the message config, without the need for the client to fill the group member list by itself.

Protected Functions#

Name
BMXClient()

Additional inherited members#

Public Functions inherited from floo::BMXNetworkListener

Name
virtual~BMXNetworkListener()

Public Functions Documentation#

function create#

static BMXClientPtr create(
    BMXSDKConfigPtr config
)

Create BMXClient

Parameters:

  • config BMXSDKConfig SDK configuration object created by local client-side already

Return: BMXClientPtr

Example:

{% lanying_code_snippet repo="lanying-im-embedded",class="BMXClient",function="create" %}{% endlanying_code_snippet %}

function ~BMXClient#

inline virtual ~BMXClient()

Destructor

Example:

{% lanying_code_snippet repo="lanying-im-embedded",class="BMXClient",function="~BMXClient" %}{% endlanying_code_snippet %}

function getSDKConfig#

virtual BMXSDKConfigPtr getSDKConfig() =0

Get SDK settings

Return: BMXSDKConfigPtr

Example:

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

function getUserService#

virtual BMXUserService & getUserService() =0

Get user Service

Return: BMXUserService

Example:

{% lanying_code_snippet repo="lanying-im-embedded",class="BMXClient",function="getUserService" %}{% endlanying_code_snippet %}

function getChatService#

virtual BMXChatService & getChatService() =0

Get chat Service

Return: BMXChatService

Example:

{% lanying_code_snippet repo="lanying-im-embedded",class="BMXClient",function="getChatService" %}{% endlanying_code_snippet %}

function getGroupService#

virtual BMXGroupService & getGroupService() =0

Get group Service

Return: BMXGroupService

Example:

{% lanying_code_snippet repo="lanying-im-embedded",class="BMXClient",function="getGroupService" %}{% endlanying_code_snippet %}

function getRosterService#

virtual BMXRosterService & getRosterService() =0

Get roster Service

Return: BMXRosterService

Example:

{% lanying_code_snippet repo="lanying-im-embedded",class="BMXClient",function="getRosterService" %}{% endlanying_code_snippet %}

function getPushService#

virtual BMXPushService & getPushService() =0

Get push Service

Return: BMXPushService

Example:

{% lanying_code_snippet repo="lanying-im-embedded",class="BMXClient",function="getPushService" %}{% endlanying_code_snippet %}

function signUpNewUser#

virtual BMXErrorCode signUpNewUser(
    const std::string & username,
    const std::string & password,
    BMXUserProfilePtr & bmxUserProfilePtr
) =0

To register a new user, username and password are required

Parameters:

  • username Username
  • password User password
  • bmxUserProfilePtr After successful registration, get the profile of the newly registered user from this function, and initially passed in a pointing-to-empty shared_ptr object.

Return: BMXErrorCode

Example:

{% lanying_code_snippet repo="lanying-im-embedded",class="BMXClient",function="signUpNewUser" %}{% endlanying_code_snippet %}

function signInByName#

virtual BMXErrorCode signInByName(
    const std::string & name,
    const std::string & password
) =0

Login by username

Parameters:

  • name Username
  • password User password

Return: BMXErrorCode

Example:

{% lanying_code_snippet repo="lanying-im-embedded",class="BMXClient",function="signInByName" %}{% endlanying_code_snippet %}

function signInById#

virtual BMXErrorCode signInById(
    int64_t ,
    const std::string & password
) =0

Login by user ID

Parameters:

  • int64_t User id
  • password User password

Return: BMXErrorCode

Example:

{% lanying_code_snippet repo="lanying-im-embedded",class="BMXClient",function="signInById" %}{% endlanying_code_snippet %}

function fastSignInByName#

virtual BMXErrorCode fastSignInByName(
    const std::string & name,
    const std::string & password
) =0

Quick login by username (requires a successful previous login, faster login)

Parameters:

  • name Username
  • password User password (for sdk to automatically update user token when internal token expires)

Return: BMXErrorCode

Example:

{% lanying_code_snippet repo="lanying-im-embedded",class="BMXClient",function="fastSignInByName" %}{% endlanying_code_snippet %}

function fastSignInById#

virtual BMXErrorCode fastSignInById(
    int64_t uid,
    const std::string & password
) =0

Quick login by user ID (requires a successful previous login, faster login)

Parameters:

  • uid User id
  • password User password (for sdk to automatically update user token when internal token expires)

Return: BMXErrorCode

Example:

{% lanying_code_snippet repo="lanying-im-embedded",class="BMXClient",function="fastSignInById" %}{% endlanying_code_snippet %}

function signOut#

virtual BMXErrorCode signOut(
    int64_t uid =0,
    bool ignoreUnbindDevice =false
) =0

Log out

Parameters:

  • uid UID of logged out user (default 0 to logout the current user)
  • ignoreUnbindDevice Whether the unbind device operation is ignored when the user logout. Set to true when server's unbinding device operation is ignored and forced to logout directly when some servers are inaccessible.

Return: BMXErrorCode

Example:

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

function connectStatus#

virtual BMXConnectStatus connectStatus() =0

Get the current connection state with server

Return: BMXConnectStatus

Example:

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

function signInStatus#

virtual BMXSignInStatus signInStatus() =0

Get the current login state

Return: BMXSignInStatus

Example:

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

function reconnect#

virtual void reconnect() =0

Force reconnection

Example:

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

function onNetworkChanged#

virtual void onNetworkChanged(
    BMXNetworkType type,
    bool reconnect
) =0

Process network changes in messaging

Parameters:

  • type Changed network type
  • reconnect Network needs to reconnect or not

Reimplements: floo::BMXNetworkListener::onNetworkChanged

Example:

{% lanying_code_snippet repo="lanying-im-embedded",class="BMXClient",function="onNetworkChanged" %}{% endlanying_code_snippet %}

function disconnect#

virtual void disconnect() =0

Disconnect

Example:

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

function changeAppId#

virtual BMXErrorCode changeAppId(
    const std::string & appId,
    const std::string & appSecret =""
) =0

Change the appId of SDK, which also update the appId in BMXConfig.

Parameters:

  • appId Newly changed appId

Return: BMXErrorCode

Example:

{% lanying_code_snippet repo="lanying-im-embedded",class="BMXClient",function="changeAppId" %}{% endlanying_code_snippet %}

function initializeServerConfig#

virtual BMXErrorCode initializeServerConfig(
    bool isLocal
) =0

Get the server network configuration of app, which can be called after initializing SDK and before logging in, so as to get the server configuration in advance and speed up logging in.

Parameters:

  • isLocal True to use locally cached DNS configuration, false to get the latest configuration from server.

Return: BMXErrorCode

Example:

{% lanying_code_snippet repo="lanying-im-embedded",class="BMXClient",function="initializeServerConfig" %}{% endlanying_code_snippet %}

function sendMessage#

virtual void sendMessage(
    BMXMessagePtr msg
) =0

When send a message, the change of message status will be notified by listener. In the case of sending a group message in a specified group with group read acknowledgement enabled, the interface will automatically obtain the group member list id and fill it in the message config, without the need for the client to fill the group member list by itself.

Parameters:

  • msg Message to be sent

Protected Functions Documentation#

Example:

{% lanying_code_snippet repo="lanying-im-embedded",class="BMXClient",function="sendMessage" %}{% endlanying_code_snippet %}

function BMXClient#

BMXClient()

Example:

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

Updated on 2022-01-26 at 17:20:40 +0800

Generated API content with concise AI notes where context helps.