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 |
| BMXClientType | getClientType() Client type |
| const std::string & | getVsn() Client OS version |
| const std::string & | getSDKVersion() SDK version |
| const std::string & | getPushCertName() Get Push certificate name |
| void | setPushCertName(const std::string & ) Set Push certificate name |
| const std::string & | getUserAgent() Get user proxy information |
| bool | carryUsernameInMessage() Whether the config sends message carrying |
| void | setCarryUsernameInMessage(bool ) Set whether the config sends message carrying username |
| bool | enableDeliveryAck() Whether to send message delivery acknowledgement |
| void | setEnableDeliveryAck(bool ) Set whether to send message delivery acknowledgement |
| BMXLogLevel | getLogLevel() Log output level |
| void | setLogLevel(BMXLogLevel ) Set Log output level |
| bool | getConsoleOutput() Whether to output Log to Console. |
| void | setConsoleOutput(bool ) Set whether to output Log to Console |
| void | setHostConfig(const [HostConfig] & config) Set server configuration |
| const [HostConfig] & | getHostConfig() Get server configuration |
| bool | getLoadAllServerConversations() Whether to create all conversations based on the unread list returned by server. |
| 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. |
| const std::string & | getDeviceUuid() Get the unique identifier of device |
| 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. |
| const std::string & | getDBCryptoKey() Get the local database encryption key for the device. |
| 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. |
| bool | getVerifyCertificate() Whether need to verify server-side certificate when get https request. |
| void | setVerifyCertificate(bool verify =true) Set whether https request verify server-side certificate. |
| bool | getEnableDNS() Whether to enable dns function for get. |
| void | setEnableDNS(bool enable =true) Set whether to enable dns function for get, default enabled. |
| std::string | getUserDNSAddress() Get user-defined dns server address. |
| void | setUserDNSAddress(const std::string & dns) Set user-defined dns server address, preferring user dns if dns server has been set. |
| std::string | getAppID() Get user's appID. |
| void | setAppID(const std::string & appID) Set user's appID. |
| std::string | getAppSecret() Get user's appSecret. |
| void | setAppSecret(const std::string & appSecret) Set user's appSecret. |
| BMXPushProviderType | getPushProviderType() Get user's Push provider type. |
| void | setPushProviderType(BMXPushProviderType type) Set user's Push provider type. |
| BMXPushEnvironmentType | getPushEnvironmentType() Get user's Push environment type. |
| void | setEnvironmentType(BMXPushEnvironmentType type) Set user's Push environment type. |
| int64_t | getDebugLogReceiverId() Get debug log receiving account (for SDK debugging only, used for receiving client log) |
| void | setDebugLogReceiverId(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
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
function ~BMXSDKConfig#
virtual ~BMXSDKConfig()
Destructor
function getDataDir#
const std::string & getDataDir()
Get storage path of chat data, including messages, attachments, and more
Return: std::string
function getCacheDir#
const std::string & getCacheDir()
Get storage path of cached data, including user avatar and more
Return: std::string
function getClientType#
BMXClientType getClientType()
Client type
Return: BMXClientType
function getVsn#
const std::string & getVsn()
Client OS version
Return: std::string
function getSDKVersion#
const std::string & getSDKVersion()
SDK version
Return: std::string
function getPushCertName#
const std::string & getPushCertName()
Get Push certificate name
Return: std::string
function setPushCertName#
void setPushCertName(
const std::string &
)
Set Push certificate name
Return: std::string
function getUserAgent#
const std::string & getUserAgent()
Get user proxy information
Return: std::string
function carryUsernameInMessage#
bool carryUsernameInMessage()
Whether the config sends message carrying
Return: bool
function setCarryUsernameInMessage#
void setCarryUsernameInMessage(
bool
)
Set whether the config sends message carrying username
Parameters:
- bool Set whether the config sends message carrying username
function enableDeliveryAck#
bool enableDeliveryAck()
Whether to send message delivery receipts
Return: bool
function setEnableDeliveryAck#
void setEnableDeliveryAck(
bool
)
Set whether to send message delivery acknowledgement
Parameters:
- bool Whether to send message delivery acknowledgement
function getLogLevel#
BMXLogLevel getLogLevel()
Log level
Return: BMXLogLevel
function setLogLevel#
void setLogLevel(
BMXLogLevel
)
Set Log output level
Parameters:
- BMXLogLevel Log output level
function getConsoleOutput#
bool getConsoleOutput()
Whether to output Log to Console.
Return: bool
function setConsoleOutput#
void setConsoleOutput(
bool
)
Whether to write logs to the console
Parameters:
- bool Set whether to output Log to Console
function setHostConfig#
void setHostConfig(
const HostConfig & config
)
Set server configuration
Parameters:
- config Server configuration
function getHostConfig#
const HostConfig & getHostConfig()
Get server configuration
Return: [HostConfig]
function getLoadAllServerConversations#
bool getLoadAllServerConversations()
Whether to create all conversations based on the unread list returned by server.
Return: bool
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
function getDeviceUuid#
const std::string & getDeviceUuid()
Get the unique identifier of device
Return: std::string
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.
function getDBCryptoKey#
const std::string & getDBCryptoKey()
Get the local database encryption key for the device.
Return: std::string
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.
function getVerifyCertificate#
bool getVerifyCertificate()
Whether need to verify server-side certificate when get https request.
Return: bool
function setVerifyCertificate#
void setVerifyCertificate(
bool verify =true
)
Set whether https request verify server-side certificate.
Parameters:
- verify Whether https request verify server-side certificate
function getEnableDNS#
bool getEnableDNS()
Whether to enable dns function for get.
Return: bool
function setEnableDNS#
void setEnableDNS(
bool enable =true
)
Set whether to enable dns function for get, default enabled.
Parameters:
- enable Whether to enable dns function
function getUserDNSAddress#
std::string getUserDNSAddress()
Get user-defined dns server address.
Return: std::string
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
function getAppID#
std::string getAppID()
Get user's appID.
Return: std::string
function setAppID#
void setAppID(
const std::string & appID
)
Set user's appID.
Parameters:
- appID User's appID
function getAppSecret#
std::string getAppSecret()
Get user's appSecret.
Return: std::string
function setAppSecret#
void setAppSecret(
const std::string & appSecret
)
Set user's appSecret.
Parameters:
- appID User's appSecret
function getPushProviderType#
BMXPushProviderType getPushProviderType()
Get user's Push provider type.
Return: BMXPushProviderType
function setPushProviderType#
void setPushProviderType(
BMXPushProviderType type
)
Set user's Push provider type.
Parameters:
- type User's push provider type
function getPushEnvironmentType#
BMXPushEnvironmentType getPushEnvironmentType()
Get user's Push environment type.
Return: BMXPushEnvironmentType
function setEnvironmentType#
void setEnvironmentType(
BMXPushEnvironmentType type
)
Set user's Push environment type.
Parameters:
- type User's push environment type
function getDebugLogReceiverId#
int64_t getDebugLogReceiverId()
Get debug log receiving account (for SDK debugging only, used for receiving client log)
Return: int64_t
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
Updated on 2022-01-26 at 17:20:40 +0800