LANYINGDevelopers
Web & Mini ProgramiOSAndroidC++Server API

floo::BMXSDKConfig#

SDK settings management

#include <bmx_sdk_config.h>

Public Functions#

Name
BMXSDKConfig(BMXClientType type, const std::string & vsn, const std::string & dataDir, const std::string & cacheDir, const std::string & SDKVersion, const std::string & pushCertName, const std::string & userAgent, bool deliveryAck =false)
Constructor
BMXSDKConfig(BMXClientType type, const std::string & vsn, const std::string & dataDir, const std::string & cacheDir, const std::string & SDKVersion, const std::string & pushCertName, const std::string & userAgent, const std::string & appId, const std::string & appSecret, bool deliveryAck =false)
Constructor
virtual~BMXSDKConfig()
Destructor
const std::string &getDataDir()
Get storage path of chat data, including messages, attachments, and more
const std::string &getCacheDir()
Get storage path of cached data, including user avatar and more
BMXClientTypegetClientType()
Client type
const std::string &getVsn()
Client OS version
const std::string &getSDKVersion()
SDK version
const std::string &getPushCertName()
Get Push certificate name
voidsetPushCertName(const std::string & )
Set Push certificate name
const std::string &getUserAgent()
Get user proxy information
boolcarryUsernameInMessage()
Whether the config sends message carrying
voidsetCarryUsernameInMessage(bool )
Set whether the config sends message carrying username
boolenableDeliveryAck()
Whether to send message delivery acknowledgement
voidsetEnableDeliveryAck(bool )
Set whether to send message delivery acknowledgement
BMXLogLevelgetLogLevel()
Log output level
voidsetLogLevel(BMXLogLevel )
Set Log output level
boolgetConsoleOutput()
Whether to output Log to Console.
voidsetConsoleOutput(bool )
Set whether to output Log to Console
voidsetHostConfig(const [HostConfig] & config)
Set server configuration
const [HostConfig] &getHostConfig()
Get server configuration
boolgetLoadAllServerConversations()
Whether to create all conversations based on the unread list returned by server.
voidsetLoadAllServerConversations(bool enable =false)
Whether to create all conversations based on the unread list returned by server, default false to create conversations with unread only.
const std::string &getDeviceUuid()
Get the unique identifier of device
voidsetDeviceUuid(const std::string & uuid)
Set the unique ID of the device, which should always be consistent before the app is uninstalled. Different device IDs can be generated when the app is deleted and installed again.
const std::string &getDBCryptoKey()
Get the local database encryption key for the device.
voidsetDBCryptoKey(const std::string & cryptoKey)
Set the encryption key of the local database, which should always be kept until the app is uninstalled, and a different key can be generated when the app is deleted and installed again. Used for local database encryption.
boolgetVerifyCertificate()
Whether need to verify server-side certificate when get https request.
voidsetVerifyCertificate(bool verify =true)
Set whether https request verify server-side certificate.
boolgetEnableDNS()
Whether to enable dns function for get.
voidsetEnableDNS(bool enable =true)
Set whether to enable dns function for get, default enabled.
std::stringgetUserDNSAddress()
Get user-defined dns server address.
voidsetUserDNSAddress(const std::string & dns)
Set user-defined dns server address, preferring user dns if dns server has been set.
std::stringgetAppID()
Get user's appID.
voidsetAppID(const std::string & appID)
Set user's appID.
std::stringgetAppSecret()
Get user's appSecret.
voidsetAppSecret(const std::string & appSecret)
Set user's appSecret.
BMXPushProviderTypegetPushProviderType()
Get user's Push provider type.
voidsetPushProviderType(BMXPushProviderType type)
Set user's Push provider type.
BMXPushEnvironmentTypegetPushEnvironmentType()
Get user's Push environment type.
voidsetEnvironmentType(BMXPushEnvironmentType type)
Set user's Push environment type.
int64_tgetDebugLogReceiverId()
Get debug log receiving account (for SDK debugging only, used for receiving client log)
voidsetDebugLogReceiverId(int64_t uid)
Set debug log receiving account (for SDK debugging only, used for receiving client log)

Public Functions Documentation#

function BMXSDKConfig#

BMXSDKConfig(
    BMXClientType type,
    const std::string & vsn,
    const std::string & dataDir,
    const std::string & cacheDir,
    const std::string & SDKVersion,
    const std::string & pushCertName,
    const std::string & userAgent,
    bool deliveryAck =false
)

Constructor

Parameters:

  • type Client type
  • vsn Client OS version
  • dataDir Storage path of chat data
  • cacheDir Storage path of cached data
  • SDKVersion SDK version
  • pushCertName Push certificate name
  • userAgent User agent information
  • deliveryAck Whether to send message delivery acknowledgement

Example:

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

function BMXSDKConfig#

BMXSDKConfig(
    BMXClientType type,
    const std::string & vsn,
    const std::string & dataDir,
    const std::string & cacheDir,
    const std::string & SDKVersion,
    const std::string & pushCertName,
    const std::string & userAgent,
    const std::string & appId,
    const std::string & appSecret,
    bool deliveryAck =false
)

Constructor

Parameters:

  • type Client type
  • vsn Client OS version
  • dataDir Storage path of chat data
  • cacheDir Storage path of cached data
  • SDKVersion SDK version
  • pushCertName Push certificate name
  • userAgent User agent information
  • appId User's appId
  • appSecret User's appSecret (for users using push, both appId and appSecret must be set)
  • deliveryAck Whether to send message delivery acknowledgement

Example:

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

function ~BMXSDKConfig#

virtual ~BMXSDKConfig()

Destructor

Example:

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

function getDataDir#

const std::string & getDataDir()

Get storage path of chat data, including messages, attachments, and more

Return: std::string

Example:

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

function getCacheDir#

const std::string & getCacheDir()

Get storage path of cached data, including user avatar and more

Return: std::string

Example:

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

function getClientType#

BMXClientType getClientType()

Client type

Return: BMXClientType

Example:

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

function getVsn#

const std::string & getVsn()

Client OS version

Return: std::string

Example:

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

function getSDKVersion#

const std::string & getSDKVersion()

SDK version

Return: std::string

Example:

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

function getPushCertName#

const std::string & getPushCertName()

Get Push certificate name

Return: std::string

Example:

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

function setPushCertName#

void setPushCertName(
    const std::string & 
)

Set Push certificate name

Return: std::string

Example:

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

function getUserAgent#

const std::string & getUserAgent()

Get user proxy information

Return: std::string

Example:

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

function carryUsernameInMessage#

bool carryUsernameInMessage()

Whether the config sends message carrying

Return: bool

Example:

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

function setCarryUsernameInMessage#

void setCarryUsernameInMessage(
    bool 
)

Set whether the config sends message carrying username

Parameters:

  • bool Set whether the config sends message carrying username

Example:

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

function enableDeliveryAck#

bool enableDeliveryAck()

Whether to send message delivery receipts

Return: bool

Example:

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

function setEnableDeliveryAck#

void setEnableDeliveryAck(
    bool 
)

Set whether to send message delivery acknowledgement

Parameters:

  • bool Whether to send message delivery acknowledgement

Example:

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

function getLogLevel#

BMXLogLevel getLogLevel()

Log level

Return: BMXLogLevel

Example:

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

function setLogLevel#

void setLogLevel(
    BMXLogLevel 
)

Set Log output level

Parameters:

  • BMXLogLevel Log output level

Example:

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

function getConsoleOutput#

bool getConsoleOutput()

Whether to output Log to Console.

Return: bool

Example:

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

function setConsoleOutput#

void setConsoleOutput(
    bool 
)

Whether to write logs to the console

Parameters:

  • bool Set whether to output Log to Console

Example:

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

function setHostConfig#

void setHostConfig(
    const HostConfig & config
)

Set server configuration

Parameters:

  • config Server configuration

Example:

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

function getHostConfig#

const HostConfig & getHostConfig()

Get server configuration

Return: [HostConfig]

Example:

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

function getLoadAllServerConversations#

bool getLoadAllServerConversations()

Whether to create all conversations based on the unread list returned by server.

Return: bool

Example:

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

function setLoadAllServerConversations#

void setLoadAllServerConversations(
    bool enable =false
)

Whether to create all conversations based on the unread list returned by server, default false to create conversations with unread only.

Parameters:

  • enable Whether to create all conversations based on the unread list returned by server

Example:

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

function getDeviceUuid#

const std::string & getDeviceUuid()

Get the unique identifier of device

Return: std::string

Example:

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

function setDeviceUuid#

void setDeviceUuid(
    const std::string & uuid
)

Set the unique ID of the device, which should always be consistent before the app is uninstalled. Different device IDs can be generated when the app is deleted and installed again.

Parameters:

  • uuid Unique identifier of device.

Example:

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

function getDBCryptoKey#

const std::string & getDBCryptoKey()

Get the local database encryption key for the device.

Return: std::string

Example:

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

function setDBCryptoKey#

void setDBCryptoKey(
    const std::string & cryptoKey
)

Set the encryption key of the local database, which should always be kept until the app is uninstalled, and a different key can be generated when the app is deleted and installed again. Used for local database encryption.

Parameters:

  • cryptoKey Local database encryption key.

Example:

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

function getVerifyCertificate#

bool getVerifyCertificate()

Whether need to verify server-side certificate when get https request.

Return: bool

Example:

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

function setVerifyCertificate#

void setVerifyCertificate(
    bool verify =true
)

Set whether https request verify server-side certificate.

Parameters:

  • verify Whether https request verify server-side certificate

Example:

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

function getEnableDNS#

bool getEnableDNS()

Whether to enable dns function for get.

Return: bool

Example:

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

function setEnableDNS#

void setEnableDNS(
    bool enable =true
)

Set whether to enable dns function for get, default enabled.

Parameters:

  • enable Whether to enable dns function

Example:

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

function getUserDNSAddress#

std::string getUserDNSAddress()

Get user-defined dns server address.

Return: std::string

Example:

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

function setUserDNSAddress#

void setUserDNSAddress(
    const std::string & dns
)

Set user-defined dns server address, preferring user dns if dns server has been set.

Parameters:

  • dns User-defined dns server address

Example:

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

function getAppID#

std::string getAppID()

Get user's appID.

Return: std::string

Example:

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

function setAppID#

void setAppID(
    const std::string & appID
)

Set user's appID.

Parameters:

  • appID User's appID

Example:

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

function getAppSecret#

std::string getAppSecret()

Get user's appSecret.

Return: std::string

Example:

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

function setAppSecret#

void setAppSecret(
    const std::string & appSecret
)

Set user's appSecret.

Parameters:

  • appID User's appSecret

Example:

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

function getPushProviderType#

BMXPushProviderType getPushProviderType()

Get user's Push provider type.

Return: BMXPushProviderType

Example:

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

function setPushProviderType#

void setPushProviderType(
    BMXPushProviderType type
)

Set user's Push provider type.

Parameters:

  • type User's push provider type

Example:

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

function getPushEnvironmentType#

BMXPushEnvironmentType getPushEnvironmentType()

Get user's Push environment type.

Return: BMXPushEnvironmentType

Example:

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

function setEnvironmentType#

void setEnvironmentType(
    BMXPushEnvironmentType type
)

Set user's Push environment type.

Parameters:

  • type User's push environment type

Example:

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

function getDebugLogReceiverId#

int64_t getDebugLogReceiverId()

Get debug log receiving account (for SDK debugging only, used for receiving client log)

Return: int64_t

Example:

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

function setDebugLogReceiverId#

void setDebugLogReceiverId(
    int64_t uid
)

Set debug log receiving account (for SDK debugging only, used for receiving client log)

Parameters:

  • uid Debug log receiver id

Example:

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

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

Generated API content with concise AI notes where context helps.