NIM PC Cross Platform SDK
载入中...
搜索中...
未找到
nim::SDKConfig结构体 参考

SDK初始化参数 更多...

#include <nim_client_helper.h>

Public 成员函数

 SDKConfig ()
 
void SetCustomClientType (int type)
 
int GetCustomClientType () const
 

Public 属性

std::string push_cer_name_
 
std::string push_token_
 
std::string database_encrypt_key_
 string 数据库秘钥
 
bool encrypt_unencrypted_db_ {false}
 
uint64_t encrypt_unencrypted_db_threshold_ {kDefaultEncryptUnencryptedDBThreshold}
 uint64_t KB 未加密数据库大小阈值,超过该阈值则忽略补充加密, 0 表示无阈值
 
bool preload_attach_
 
int preload_image_quality_
 int 预下载图片的质量,范围 0-100
 
std::string preload_image_resize_
 string 预下载图片基于长宽做内缩略,比如宽 100 高 50,则赋值为 100x50,中间为小写字母 x
 
std::string preload_image_name_template_
 string 预下载图片命名规则,以{filename}为token进行替换
 
NIMSDKLogLevel sdk_log_level_
 NIMSDKLogLevel 定义见 NIMSDKLogLevel,SDK 默认的内置级别为 kNIMSDKLogLevelPro
 
bool sync_session_ack_
 bool 设置是否在初始化时多端同步已读未读状态,默认true
 
int login_max_retry_times_
 int 登录重试最大次数,默认填0,SDK默认设置次数,如需设置建议设置大于 3 次
 
int custom_timeout_
 int 自定义通讯超时时间,暂时不开放设置
 
bool use_https_
 bool 是否启用 HTTPS 协议,默认为 true
 
bool team_notification_unread_count_
 bool 群通知是否计入未读数,默认为 false
 
bool vchat_miss_unread_count_
 bool 语音消息未接通消息是否计入未读数,默认为false
 
bool reset_unread_count_when_recall_
 bool 撤回消息后是否重新计算未读消息计数,默认为false
 
bool upload_sdk_events_after_login_
 bool 在调用 Login 接口后无论成功与否,是否上报历史错误日志到服务器(目前支持 408、415、500),默认为 false
 
bool animated_image_thumbnail_enabled_
 bool 是否开启对动图缩略图的支持,默认为 false。开启后获取的缩略图为原格式,关闭后获取的缩略图为第一帧静态图
 
bool client_antispam_
 
bool team_msg_ack_
 
bool team_query_tinfo_override_by_local_ {true}
 bool 是否在群组消息查询时,是否使用本地数据对 member_valid 字段进行覆盖
 
bool need_update_lbs_befor_relogin_
 bool 在进行重新登录前是否先刷新 LBS,适用于切换网络的场景
 
std::list< NIMMessageTypesession_ignore_msg_types_
 list<NIMMessageType> 更新会话时忽略某种消息类型,默认为空
 
int custom_client_type_
 int, 自定义客户端类型字段,启用该配置时必须 0,否则初始化会报错
 
bool caching_markread_
 bool 是否开启缓存式“已接收回执”发送,程序可能收到大量消息以至触发频控时可以考虑开启此开关 缺省 false 关闭
 
uint32_t caching_markread_time_ {0}
 uint32 caching_markread_ == true 时有效 缓存时间 单位ms 缺省 1000
 
uint32_t caching_markread_count_ {0}
 uint32 caching_markread_ == true 时有效 缓存的最大消息条数 缺省 10
 
bool enable_user_datafile_backup_
 bool 是否开启用户数据备份(本地)功能 缺省true
 
bool enable_user_datafile_restore_
 bool 是否开启用户数据恢复(本地)功能 缺省false
 
bool enable_user_datafile_defrestoreproc_
 bool 是否使用缺省的用户数据恢复(本地)方案 缺省false enable_user_datafile_restore_ == true 生效
 
std::string user_datafile_localbackup_folder_
 string 用户数据文件备份(本地)目录,缺省在数据文件所在目录创建一个db_file.back目录
 
int ip_protocol_version_
 int IP地址族设置 0:ipv4 1:ipv6 2:auto,经SDK测试后,自行选择,会有少许性能损耗。缺省 0(ipv4)
 
bool dedicated_cluste_flag_
 bool 是否为专属集群 {true,false} def:false
 
int hand_shake_type_
 int 登录时使用的握手协议类型 0:支持配置多种对称与非对称加密算法,1:只支持RAS + RC4,缺省 0
 
int nego_key_neca_
 int "交换密钥"协议加密算法 {1(RSA),2(SM2)}, def:1(RSA) 非对称加密
 
int comm_neca_
 int 通信加密算法 {1(RC4),2(AES128),4(SM4)} def:1(RC4) 对称加密
 
std::string server_conf_file_path_
 string 私有云服务器相关地址配置文件本地绝对路径,如果不填默认执行文件目录下的server_conf.txt
 
bool use_private_server_
 bool 是否使用私有服务器,如果使用私有服务器,则必须设置为 true
 
std::string lbs_address_
 string lbs地址,如果选择使用私有服务器,则必填
 
std::list< std::string > lbs_backup_address_
 string list lbs备用地址,没有可不填
 
std::string nos_lbs_address_
 string nos lbs地址,如果选择使用私有服务器,则必填
 
std::string default_link_address_
 string 默认link服务器地址,如果选择使用私有服务器,ip_protocol_version_ != 1(ipv4 or auto)则必填
 
std::string default_link_address_ipv6_
 string 默认link ipv6服务器地址,如果选择使用私有服务器,ip_protocol_version_ == 1(使用ipv6)则必填
 
std::string default_nos_upload_address_
 string 默认nos 上传服务器地址,如果选择使用私有服务器,则必填
 
std::string default_nos_upload_host_
 string 默认nos 上传服务器主机地址,仅 kNIMUseHttps设置为true 时有效,用作 https 上传时的域名校验及 http header host 字段填充
 
std::string rsa_public_key_module_
 string RSA public key,如果选择使用私有服务器,则必填 【6.9.0版本后已废弃】
 
int rsa_version_
 int RSA version,如果选择使用私有服务器,则必填 【6.9.0版本后已废弃】
 
std::string nego_key_neca_key_parta_
 string "交换密钥"协议加密算法密钥 part A 自定义时则必填 BigNumHex string 不含0x RSA:module,SM2:X
 
std::string nego_key_neca_key_partb_
 string 非对称加密算法key2 RSA:EXP,SM2: SM2Y 自定义时则必填
 
int nego_key_neca_key_version_
 int 非对称加密算法的 key version 自定义时则必填
 
std::string nos_download_address_
 string nos 下载地址拼接模板,用于拼接最终得到的下载地址
 
std::string nos_accelerate_host_
 string 需要被加速主机名【8.1.0版本以及后不建议使用,推荐nos_accelerate_host_list_】
 
std::vector< std::string > nos_accelerate_host_list_
 string array,需要被加速主机名列表
 
std::string nos_accelerate_address_
 string nos 加速地址拼接模板,用于获得加速后的下载地址
 
std::string probe_ipv4_url_
 string 探测ipv4地址类型使用的url,ip_protocol_version_ == 2(auto) 时生效
 
std::string probe_ipv6_url_
 string 探测ipv6地址类型使用的url,ip_protocol_version_ == 2(auto) 时生效
 
std::map< int, int > sync_data_type_list_
 map 数据同步类型 key(28:置顶会话) value(0:不同步,1:自动同步)
 
std::list< std::string > http_dns_server_interface_
 string list httpdns服务请求地址,如果没有特定地址可以不填
 
bool priority_use_cdn_host_
 bool 是否优先使用cdn域名
 
bool disable_app_nap_
 string 是否禁用 macOS 下的 App Nap 功能,默认为 true
 
bool cache_session_data_when_delete_
 bool 删除会话时是否在数据库缓存会话原数据,默认为 false
 
NIMSDKType sdk_type
 客户端sdk类型
 
std::string sdk_human_version
 sdk可读版本号
 
std::string mock_refer_
 
std::string mock_ua_
 
int fcs_auth_type_
 融合云存储认证方式 1=refer鉴权,2=基于时间的token鉴权,3=基于url的token鉴权,4=custom鉴权
 
bool custom_enable_fcs_
 是否开启融合云存储
 
uint32_t ntp_max_rtt_
 NTP 最大可信任延迟 ms
 
uint32_t ntp_ideal_rtt_
 IDEAL 时间 ms
 
uint32_t ntp_max_fetch_times_
 最大校对次数
 

友元

class Client
 

详细描述

SDK初始化参数

构造及析构函数说明

◆ SDKConfig()

nim::SDKConfig::SDKConfig ( )

构造函数

成员函数说明

◆ GetCustomClientType()

int nim::SDKConfig::GetCustomClientType ( ) const

◆ SetCustomClientType()

void nim::SDKConfig::SetCustomClientType ( int  type)

友元及相关函数文档

◆ Client

friend class Client
friend

类成员变量说明

◆ animated_image_thumbnail_enabled_

bool nim::SDKConfig::animated_image_thumbnail_enabled_

bool 是否开启对动图缩略图的支持,默认为 false。开启后获取的缩略图为原格式,关闭后获取的缩略图为第一帧静态图

◆ cache_session_data_when_delete_

bool nim::SDKConfig::cache_session_data_when_delete_

bool 删除会话时是否在数据库缓存会话原数据,默认为 false

◆ caching_markread_

bool nim::SDKConfig::caching_markread_

bool 是否开启缓存式“已接收回执”发送,程序可能收到大量消息以至触发频控时可以考虑开启此开关 缺省 false 关闭

◆ caching_markread_count_

uint32_t nim::SDKConfig::caching_markread_count_ {0}

uint32 caching_markread_ == true 时有效 缓存的最大消息条数 缺省 10

◆ caching_markread_time_

uint32_t nim::SDKConfig::caching_markread_time_ {0}

uint32 caching_markread_ == true 时有效 缓存时间 单位ms 缺省 1000

◆ client_antispam_

bool nim::SDKConfig::client_antispam_

bool 是否开启客户端反垃圾(客户端本地的内容审核能力),默认为 false。开启后,将在初始化时从服务端获取您在云信控制台配置的反垃圾词库。如需开启请提前咨询技术支持或销售开通客户端反垃圾功能

注解
客户端反垃圾的配置详情,请参见 反垃圾(内容审核)

◆ comm_neca_

int nim::SDKConfig::comm_neca_

int 通信加密算法 {1(RC4),2(AES128),4(SM4)} def:1(RC4) 对称加密

◆ custom_client_type_

int nim::SDKConfig::custom_client_type_

int, 自定义客户端类型字段,启用该配置时必须 0,否则初始化会报错

◆ custom_enable_fcs_

bool nim::SDKConfig::custom_enable_fcs_

是否开启融合云存储

◆ custom_timeout_

int nim::SDKConfig::custom_timeout_

int 自定义通讯超时时间,暂时不开放设置

◆ database_encrypt_key_

std::string nim::SDKConfig::database_encrypt_key_

string 数据库秘钥

注解
秘钥最多可包含 32 个字符,建议使用 32 个字符的秘钥。

◆ dedicated_cluste_flag_

bool nim::SDKConfig::dedicated_cluste_flag_

bool 是否为专属集群 {true,false} def:false

◆ default_link_address_

std::string nim::SDKConfig::default_link_address_

string 默认link服务器地址,如果选择使用私有服务器,ip_protocol_version_ != 1(ipv4 or auto)则必填

◆ default_link_address_ipv6_

std::string nim::SDKConfig::default_link_address_ipv6_

string 默认link ipv6服务器地址,如果选择使用私有服务器,ip_protocol_version_ == 1(使用ipv6)则必填

◆ default_nos_upload_address_

std::string nim::SDKConfig::default_nos_upload_address_

string 默认nos 上传服务器地址,如果选择使用私有服务器,则必填

◆ default_nos_upload_host_

std::string nim::SDKConfig::default_nos_upload_host_

string 默认nos 上传服务器主机地址,仅 kNIMUseHttps设置为true 时有效,用作 https 上传时的域名校验及 http header host 字段填充

◆ disable_app_nap_

bool nim::SDKConfig::disable_app_nap_

string 是否禁用 macOS 下的 App Nap 功能,默认为 true

◆ enable_user_datafile_backup_

bool nim::SDKConfig::enable_user_datafile_backup_

bool 是否开启用户数据备份(本地)功能 缺省true

◆ enable_user_datafile_defrestoreproc_

bool nim::SDKConfig::enable_user_datafile_defrestoreproc_

bool 是否使用缺省的用户数据恢复(本地)方案 缺省false enable_user_datafile_restore_ == true 生效

◆ enable_user_datafile_restore_

bool nim::SDKConfig::enable_user_datafile_restore_

bool 是否开启用户数据恢复(本地)功能 缺省false

◆ encrypt_unencrypted_db_

bool nim::SDKConfig::encrypt_unencrypted_db_ {false}

bool 是否对未加密数据库补充加密 注意:对未加密数据库补充加密非常耗时, 可配合 encrypt_unencrypted_db_threshold_ 使用忽略较大的未加密数据库 最好在业务开发初期就决定是否要数据库加密, 就不需要使用该字段补充加密了

◆ encrypt_unencrypted_db_threshold_

uint64_t nim::SDKConfig::encrypt_unencrypted_db_threshold_ {kDefaultEncryptUnencryptedDBThreshold}

uint64_t KB 未加密数据库大小阈值,超过该阈值则忽略补充加密, 0 表示无阈值

◆ fcs_auth_type_

int nim::SDKConfig::fcs_auth_type_

融合云存储认证方式 1=refer鉴权,2=基于时间的token鉴权,3=基于url的token鉴权,4=custom鉴权

◆ hand_shake_type_

int nim::SDKConfig::hand_shake_type_

int 登录时使用的握手协议类型 0:支持配置多种对称与非对称加密算法,1:只支持RAS + RC4,缺省 0

◆ http_dns_server_interface_

std::list<std::string> nim::SDKConfig::http_dns_server_interface_

string list httpdns服务请求地址,如果没有特定地址可以不填

◆ ip_protocol_version_

int nim::SDKConfig::ip_protocol_version_

int IP地址族设置 0:ipv4 1:ipv6 2:auto,经SDK测试后,自行选择,会有少许性能损耗。缺省 0(ipv4)

◆ lbs_address_

std::string nim::SDKConfig::lbs_address_

string lbs地址,如果选择使用私有服务器,则必填

◆ lbs_backup_address_

std::list<std::string> nim::SDKConfig::lbs_backup_address_

string list lbs备用地址,没有可不填

◆ login_max_retry_times_

int nim::SDKConfig::login_max_retry_times_

int 登录重试最大次数,默认填0,SDK默认设置次数,如需设置建议设置大于 3 次

◆ mock_refer_

std::string nim::SDKConfig::mock_refer_

◆ mock_ua_

std::string nim::SDKConfig::mock_ua_

◆ need_update_lbs_befor_relogin_

bool nim::SDKConfig::need_update_lbs_befor_relogin_

bool 在进行重新登录前是否先刷新 LBS,适用于切换网络的场景

◆ nego_key_neca_

int nim::SDKConfig::nego_key_neca_

int "交换密钥"协议加密算法 {1(RSA),2(SM2)}, def:1(RSA) 非对称加密

◆ nego_key_neca_key_parta_

std::string nim::SDKConfig::nego_key_neca_key_parta_

string "交换密钥"协议加密算法密钥 part A 自定义时则必填 BigNumHex string 不含0x RSA:module,SM2:X

◆ nego_key_neca_key_partb_

std::string nim::SDKConfig::nego_key_neca_key_partb_

string 非对称加密算法key2 RSA:EXP,SM2: SM2Y 自定义时则必填

◆ nego_key_neca_key_version_

int nim::SDKConfig::nego_key_neca_key_version_

int 非对称加密算法的 key version 自定义时则必填

◆ nos_accelerate_address_

std::string nim::SDKConfig::nos_accelerate_address_

string nos 加速地址拼接模板,用于获得加速后的下载地址

◆ nos_accelerate_host_

std::string nim::SDKConfig::nos_accelerate_host_

string 需要被加速主机名【8.1.0版本以及后不建议使用,推荐nos_accelerate_host_list_】

◆ nos_accelerate_host_list_

std::vector<std::string> nim::SDKConfig::nos_accelerate_host_list_

string array,需要被加速主机名列表

◆ nos_download_address_

std::string nim::SDKConfig::nos_download_address_

string nos 下载地址拼接模板,用于拼接最终得到的下载地址

◆ nos_lbs_address_

std::string nim::SDKConfig::nos_lbs_address_

string nos lbs地址,如果选择使用私有服务器,则必填

◆ ntp_ideal_rtt_

uint32_t nim::SDKConfig::ntp_ideal_rtt_

IDEAL 时间 ms

◆ ntp_max_fetch_times_

uint32_t nim::SDKConfig::ntp_max_fetch_times_

最大校对次数

◆ ntp_max_rtt_

uint32_t nim::SDKConfig::ntp_max_rtt_

NTP 最大可信任延迟 ms

◆ preload_attach_

bool nim::SDKConfig::preload_attach_

bool 是否需要预下载多媒体消息的附件(图片和语音),默认 true

注解
如果您的业务场景对带宽流量有较高要求,请将该选项设置为 false,上层应用按需下载附件。

◆ preload_image_name_template_

std::string nim::SDKConfig::preload_image_name_template_

string 预下载图片命名规则,以{filename}为token进行替换

◆ preload_image_quality_

int nim::SDKConfig::preload_image_quality_

int 预下载图片的质量,范围 0-100

◆ preload_image_resize_

std::string nim::SDKConfig::preload_image_resize_

string 预下载图片基于长宽做内缩略,比如宽 100 高 50,则赋值为 100x50,中间为小写字母 x

◆ priority_use_cdn_host_

bool nim::SDKConfig::priority_use_cdn_host_

bool 是否优先使用cdn域名

◆ probe_ipv4_url_

std::string nim::SDKConfig::probe_ipv4_url_

string 探测ipv4地址类型使用的url,ip_protocol_version_ == 2(auto) 时生效

◆ probe_ipv6_url_

std::string nim::SDKConfig::probe_ipv6_url_

string 探测ipv6地址类型使用的url,ip_protocol_version_ == 2(auto) 时生效

◆ push_cer_name_

std::string nim::SDKConfig::push_cer_name_

string 推送证书名称(仅 iOS/Mac 有效)

注解
可在云信控制台配置推送证书名称,详情参见 集成APNs推送服务

◆ push_token_

std::string nim::SDKConfig::push_token_

string 推送的设备token (仅 iOS/Mac 有效)

注解
获取设备 token(APNs deviceToken)的详情,请参见 集成APNs推送服务

◆ reset_unread_count_when_recall_

bool nim::SDKConfig::reset_unread_count_when_recall_

bool 撤回消息后是否重新计算未读消息计数,默认为false

◆ rsa_public_key_module_

std::string nim::SDKConfig::rsa_public_key_module_

string RSA public key,如果选择使用私有服务器,则必填 【6.9.0版本后已废弃】

◆ rsa_version_

int nim::SDKConfig::rsa_version_

int RSA version,如果选择使用私有服务器,则必填 【6.9.0版本后已废弃】

◆ sdk_human_version

std::string nim::SDKConfig::sdk_human_version

sdk可读版本号

◆ sdk_log_level_

NIMSDKLogLevel nim::SDKConfig::sdk_log_level_

NIMSDKLogLevel 定义见 NIMSDKLogLevel,SDK 默认的内置级别为 kNIMSDKLogLevelPro

◆ sdk_type

NIMSDKType nim::SDKConfig::sdk_type

客户端sdk类型

◆ server_conf_file_path_

std::string nim::SDKConfig::server_conf_file_path_

string 私有云服务器相关地址配置文件本地绝对路径,如果不填默认执行文件目录下的server_conf.txt

◆ session_ignore_msg_types_

std::list<NIMMessageType> nim::SDKConfig::session_ignore_msg_types_

list<NIMMessageType> 更新会话时忽略某种消息类型,默认为空

◆ sync_data_type_list_

std::map<int , int > nim::SDKConfig::sync_data_type_list_

map 数据同步类型 key(28:置顶会话) value(0:不同步,1:自动同步)

◆ sync_session_ack_

bool nim::SDKConfig::sync_session_ack_

bool 设置是否在初始化时多端同步已读未读状态,默认true

◆ team_msg_ack_

bool nim::SDKConfig::team_msg_ack_

bool 群消息已读功能开关,默认为 false。如需开启,请先前往云信控制台开通该功能,配置路径:选择应用,进入IM免费版/专业版>功能权限开通>拓展配置>群聊>群组已读

◆ team_notification_unread_count_

bool nim::SDKConfig::team_notification_unread_count_

bool 群通知是否计入未读数,默认为 false

◆ team_query_tinfo_override_by_local_

bool nim::SDKConfig::team_query_tinfo_override_by_local_ {true}

bool 是否在群组消息查询时,是否使用本地数据对 member_valid 字段进行覆盖

◆ upload_sdk_events_after_login_

bool nim::SDKConfig::upload_sdk_events_after_login_

bool 在调用 Login 接口后无论成功与否,是否上报历史错误日志到服务器(目前支持 408、415、500),默认为 false

◆ use_https_

bool nim::SDKConfig::use_https_

bool 是否启用 HTTPS 协议,默认为 true

◆ use_private_server_

bool nim::SDKConfig::use_private_server_

bool 是否使用私有服务器,如果使用私有服务器,则必须设置为 true

◆ user_datafile_localbackup_folder_

std::string nim::SDKConfig::user_datafile_localbackup_folder_

string 用户数据文件备份(本地)目录,缺省在数据文件所在目录创建一个db_file.back目录

◆ vchat_miss_unread_count_

bool nim::SDKConfig::vchat_miss_unread_count_

bool 语音消息未接通消息是否计入未读数,默认为false


该结构体的文档由以下文件生成: