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

Example:

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:

function ~BMXSDKConfig

virtual ~BMXSDKConfig()

Destructor

Example:

function getDataDir

const std::string & getDataDir()

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

Return: std::string

Example:

function getCacheDir

const std::string & getCacheDir()

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

Return: std::string

Example:

function getClientType

BMXClientType getClientType()

Client type

Return: BMXClientType

Example:

function getVsn

const std::string & getVsn()

Client OS version

Return: std::string

Example:

function getSDKVersion

const std::string & getSDKVersion()

SDK version

Return: std::string

Example:

function getPushCertName

const std::string & getPushCertName()

Get Push certificate name

Return: std::string

Example:

function setPushCertName

void setPushCertName(
    const std::string & 
)

Set Push certificate name

Return: std::string

Example:

function getUserAgent

const std::string & getUserAgent()

Get user proxy information

Return: std::string

Example:

function carryUsernameInMessage

bool carryUsernameInMessage()

Whether the config sends message carrying

Return: bool

Example:

function setCarryUsernameInMessage

void setCarryUsernameInMessage(
    bool 
)

Set whether the config sends message carrying username

Parameters:

  • bool Set whether the config sends message carrying username

Example:

function enableDeliveryAck

bool enableDeliveryAck()

Whether to send message delivery acknowledgement

Return: bool

Example:

function setEnableDeliveryAck

void setEnableDeliveryAck(
    bool 
)

Set whether to send message delivery acknowledgement

Parameters:

  • bool Whether to send message delivery acknowledgement

Example:

function getLogLevel

BMXLogLevel getLogLevel()

Log output level

Return: BMXLogLevel

Example:

function setLogLevel

void setLogLevel(
    BMXLogLevel 
)

Set Log output level

Parameters:

  • BMXLogLevel Log output level

Example:

config->setLogLevel(BMXLogLevel::Debug);

function getConsoleOutput

bool getConsoleOutput()

Whether to output Log to Console.

Return: bool

Example:

function setConsoleOutput

void setConsoleOutput(
    bool 
)

Set whether to output Log to Console

Parameters:

  • bool Set whether to output Log to Console

Example:

config->setConsoleOutput(false);

function setHostConfig

void setHostConfig(
    const HostConfig & config
)

Set server configuration

Parameters:

  • config Server configuration

Example:

function getHostConfig

const HostConfig & getHostConfig()

Get server configuration

Return: [HostConfig]

Example:

function getLoadAllServerConversations

bool getLoadAllServerConversations()

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

Return: bool

Example:

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:

function getDeviceUuid

const std::string & getDeviceUuid()

Get the unique identifier of device

Return: std::string

Example:

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:

config->setDeviceUuid("b81f412e-fcb2-44fb-9f44-5e8e5b1e809e");

function getDBCryptoKey

const std::string & getDBCryptoKey()

Get the local database encryption key for the device.

Return: std::string

Example:

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:

config->setDBCryptoKey("testkey");

function getVerifyCertificate

bool getVerifyCertificate()

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

Return: bool

Example:

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:

function getEnableDNS

bool getEnableDNS()

Whether to enable dns function for get.

Return: bool

Example:

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:

function getUserDNSAddress

std::string getUserDNSAddress()

Get user-defined dns server address.

Return: std::string

Example:

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:

function getAppID

std::string getAppID()

Get user's appID.

Return: std::string

Example:

function setAppID

void setAppID(
    const std::string & appID
)

Set user's appID.

Parameters:

  • appID User's appID

Example:

config->setAppID("welovemaxim");

function getAppSecret

std::string getAppSecret()

Get user's appSecret.

Return: std::string

Example:

function setAppSecret

void setAppSecret(
    const std::string & appSecret
)

Set user's appSecret.

Parameters:

  • appID User's appSecret

Example:

function getPushProviderType

BMXPushProviderType getPushProviderType()

Get user's Push provider type.

Return: BMXPushProviderType

Example:

function setPushProviderType

void setPushProviderType(
    BMXPushProviderType type
)

Set user's Push provider type.

Parameters:

  • type User's push provider type

Example:

function getPushEnvironmentType

BMXPushEnvironmentType getPushEnvironmentType()

Get user's Push environment type.

Return: BMXPushEnvironmentType

Example:

function setEnvironmentType

void setEnvironmentType(
    BMXPushEnvironmentType type
)

Set user's Push environment type.

Parameters:

  • type User's push environment type

Example:

function getDebugLogReceiverId

int64_t getDebugLogReceiverId()

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

Return: int64_t

Example:

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:


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

© 2019-2023 MaximTop | Homepage Last modified time: 2023-08-09 14:48:15

results matching ""

    No results matching ""