floo::BMXSDKConfig

SDK设置管理

#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)
构造函数
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)
构造函数
virtual ~BMXSDKConfig()
析构函数
const std::string & getDataDir()
获取聊天数据存储路径,包含消息、附件等
const std::string & getCacheDir()
获取缓存数据存储路径,比如用户头像
BMXClientType getClientType()
客户端类型
const std::string & getVsn()
客户端OS版本
const std::string & getSDKVersion()
SDK版本
const std::string & getPushCertName()
获取Push证书名字
void setPushCertName(const std::string & )
设置Push证书名字
const std::string & getUserAgent()
获取用户代理信息
bool carryUsernameInMessage()
发送消息的config中是否携带
void setCarryUsernameInMessage(bool )
设置发送消息的config中是否携带用户名
bool enableDeliveryAck()
是否发送消息送达回执
void setEnableDeliveryAck(bool )
设置是否发送消息送达回执
BMXLogLevel getLogLevel()
Log输出等级
void setLogLevel(BMXLogLevel )
设置Log输出等级
bool getConsoleOutput()
Log是否输出到Console.
void setConsoleOutput(bool )
设置Log是否输出到Console
void setHostConfig(const [HostConfig] & config)
设置服务器配置
const [HostConfig] & getHostConfig()
获取服务器配置
bool getLoadAllServerConversations()
是否根据服务器返回未读列表创建所有会话.
void setLoadAllServerConversations(bool enable =false)
是否根据服务器返回未读列表创建所有会话,默认为false,只会创建有未读消息的会话。
const std::string & getDeviceUuid()
获取设备的唯一识别码
void setDeviceUuid(const std::string & uuid)
设置设备的唯一识别码,在app卸载之前应该始终保持一致,app删除后再次安装时可以产生不同的设备识别码。
const std::string & getDBCryptoKey()
获取设备的本地数据库加密密钥。
void setDBCryptoKey(const std::string & cryptoKey)
设置本地数据库的加密密钥,在app卸载之前应该始终保持一直,app删除后再次安装时可以产生不同的密钥。用于本地数据库加密。
bool getVerifyCertificate()
获取https请求是否验证服务器端证书。
void setVerifyCertificate(bool verify =true)
设置https请求是否验证服务器端证书。
bool getEnableDNS()
获取是否启用dns功能。
void setEnableDNS(bool enable =true)
设置是否启用dns功能,默认是开启的。
std::string getUserDNSAddress()
获取用户自定义dns服务器地址。
void setUserDNSAddress(const std::string & dns)
设置用户自定义dns服务器地址,在用户设置了dns服务器的情况下优先使用用户dns。
std::string getAppID()
获取用户的appID。
void setAppID(const std::string & appID)
设置用户的appID。
std::string getAppSecret()
获取用户的appSecret。
void setAppSecret(const std::string & appSecret)
设置用户的appSecret。
BMXPushProviderType getPushProviderType()
获取用户的推送提供商类型。
void setPushProviderType(BMXPushProviderType type)
设置用户的推送提供商类型。
BMXPushEnvironmentType getPushEnvironmentType()
获取用户的推送环境类型。
void setEnvironmentType(BMXPushEnvironmentType type)
设置用户的推送环境类型。
int64_t getDebugLogReceiverId()
获取调试log接收着账号(仅用于SDK调试,接收客户端log日志使用)
void setDebugLogReceiverId(int64_t uid)
设置调试log接收账号(仅用于SDK调试,接收客户端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
)

构造函数

Parameters:

  • type 客户端类型
  • vsn 客户端OS版本
  • dataDir 聊天数据存储路径
  • cacheDir 缓存数据存储路径
  • SDKVersion SDK版本
  • pushCertName Push证书名字
  • userAgent 用户代理信息
  • deliveryAck 是否发送消息送达回执

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
)

构造函数

Parameters:

  • type 客户端类型
  • vsn 客户端OS版本
  • dataDir 聊天数据存储路径
  • cacheDir 缓存数据存储路径
  • SDKVersion SDK版本
  • pushCertName Push证书名字
  • userAgent 用户代理信息
  • appId 用户的appId
  • appSecret 用户的appSecret(对于使用推送的用户,必须同时设置appId和appSecret)
  • deliveryAck 是否发送消息送达回执

Example:

function ~BMXSDKConfig

virtual ~BMXSDKConfig()

析构函数

Example:

function getDataDir

const std::string & getDataDir()

获取聊天数据存储路径,包含消息、附件等

Return: std::string

Example:

function getCacheDir

const std::string & getCacheDir()

获取缓存数据存储路径,比如用户头像

Return: std::string

Example:

function getClientType

BMXClientType getClientType()

客户端类型

Return: BMXClientType

Example:

function getVsn

const std::string & getVsn()

客户端OS版本

Return: std::string

Example:

function getSDKVersion

const std::string & getSDKVersion()

SDK版本

Return: std::string

Example:

function getPushCertName

const std::string & getPushCertName()

获取Push证书名字

Return: std::string

Example:

function setPushCertName

void setPushCertName(
    const std::string & 
)

设置Push证书名字

Return: std::string

Example:

function getUserAgent

const std::string & getUserAgent()

获取用户代理信息

Return: std::string

Example:

function carryUsernameInMessage

bool carryUsernameInMessage()

发送消息的config中是否携带

Return: bool

Example:

function setCarryUsernameInMessage

void setCarryUsernameInMessage(
    bool 
)

设置发送消息的config中是否携带用户名

Parameters:

  • bool 设置是否在送消息的config中携带用户名

Example:

function enableDeliveryAck

bool enableDeliveryAck()

是否发送消息送达回执

Return: bool

Example:

function setEnableDeliveryAck

void setEnableDeliveryAck(
    bool 
)

设置是否发送消息送达回执

Parameters:

  • bool 是否发送消息送达回执

Example:

function getLogLevel

BMXLogLevel getLogLevel()

Log输出等级

Return: BMXLogLevel

Example:

function setLogLevel

void setLogLevel(
    BMXLogLevel 
)

设置Log输出等级

Parameters:

  • BMXLogLevel Log输出等级

Example:

config->setLogLevel(BMXLogLevel::Debug);

function getConsoleOutput

bool getConsoleOutput()

Log是否输出到Console.

Return: bool

Example:

function setConsoleOutput

void setConsoleOutput(
    bool 
)

设置Log是否输出到Console

Parameters:

  • bool 设置Log是否输出到Console

Example:

config->setConsoleOutput(false);

function setHostConfig

void setHostConfig(
    const HostConfig & config
)

设置服务器配置

Parameters:

  • config 服务器配置

Example:

function getHostConfig

const HostConfig & getHostConfig()

获取服务器配置

Return: [HostConfig]

Example:

function getLoadAllServerConversations

bool getLoadAllServerConversations()

是否根据服务器返回未读列表创建所有会话.

Return: bool

Example:

function setLoadAllServerConversations

void setLoadAllServerConversations(
    bool enable =false
)

是否根据服务器返回未读列表创建所有会话,默认为false,只会创建有未读消息的会话。

Parameters:

  • enable 是否根据服务器返回未读列表创建所有会话

Example:

function getDeviceUuid

const std::string & getDeviceUuid()

获取设备的唯一识别码

Return: std::string

Example:

function setDeviceUuid

void setDeviceUuid(
    const std::string & uuid
)

设置设备的唯一识别码,在app卸载之前应该始终保持一致,app删除后再次安装时可以产生不同的设备识别码。

Parameters:

  • uuid 设备的唯一识别码。

Example:

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

function getDBCryptoKey

const std::string & getDBCryptoKey()

获取设备的本地数据库加密密钥。

Return: std::string

Example:

function setDBCryptoKey

void setDBCryptoKey(
    const std::string & cryptoKey
)

设置本地数据库的加密密钥,在app卸载之前应该始终保持一直,app删除后再次安装时可以产生不同的密钥。用于本地数据库加密。

Parameters:

  • cryptoKey 本地数据库的加密密钥。

Example:

config->setDBCryptoKey("testkey");

function getVerifyCertificate

bool getVerifyCertificate()

获取https请求是否验证服务器端证书。

Return: bool

Example:

function setVerifyCertificate

void setVerifyCertificate(
    bool verify =true
)

设置https请求是否验证服务器端证书。

Parameters:

  • verify https请求是否验证服务器端证书

Example:

function getEnableDNS

bool getEnableDNS()

获取是否启用dns功能。

Return: bool

Example:

function setEnableDNS

void setEnableDNS(
    bool enable =true
)

设置是否启用dns功能,默认是开启的。

Parameters:

  • enable 是否启用dns功能

Example:

function getUserDNSAddress

std::string getUserDNSAddress()

获取用户自定义dns服务器地址。

Return: std::string

Example:

function setUserDNSAddress

void setUserDNSAddress(
    const std::string & dns
)

设置用户自定义dns服务器地址,在用户设置了dns服务器的情况下优先使用用户dns。

Parameters:

  • dns 用户自定义dns服务器地址

Example:

function getAppID

std::string getAppID()

获取用户的appID。

Return: std::string

Example:

function setAppID

void setAppID(
    const std::string & appID
)

设置用户的appID。

Parameters:

  • appID 用户的appID

Example:

config->setAppID("welovemaxim");

function getAppSecret

std::string getAppSecret()

获取用户的appSecret。

Return: std::string

Example:

function setAppSecret

void setAppSecret(
    const std::string & appSecret
)

设置用户的appSecret。

Parameters:

  • appID 用户的appSecret

Example:

function getPushProviderType

BMXPushProviderType getPushProviderType()

获取用户的推送提供商类型。

Return: BMXPushProviderType

Example:

function setPushProviderType

void setPushProviderType(
    BMXPushProviderType type
)

设置用户的推送提供商类型。

Parameters:

  • type 用户的推送提供商类型

Example:

function getPushEnvironmentType

BMXPushEnvironmentType getPushEnvironmentType()

获取用户的推送环境类型。

Return: BMXPushEnvironmentType

Example:

function setEnvironmentType

void setEnvironmentType(
    BMXPushEnvironmentType type
)

设置用户的推送环境类型。

Parameters:

  • type 用户的推送环境类型

Example:

function getDebugLogReceiverId

int64_t getDebugLogReceiverId()

获取调试log接收着账号(仅用于SDK调试,接收客户端log日志使用)

Return: int64_t

Example:

function setDebugLogReceiverId

void setDebugLogReceiverId(
    int64_t uid
)

设置调试log接收账号(仅用于SDK调试,接收客户端log日志使用)

Parameters:

  • uid 调试log接收者id

Example:


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

© 2019-2023 美信拓扑 | 官网 该文件修订时间: 2023-08-09 14:48:15

results matching ""

    No results matching ""