im::floo::floolib::BMXSDKConfig
SDK设置管理
Public Classes
Name | |
---|---|
class | HostConfig |
Public Functions
Name | |
---|---|
synchronized void | delete() |
BMXSDKConfig([BMXClientType] type, String vsn, String dataDir, String cacheDir, String pushCertName, boolean deliveryAck) 构造函数 |
|
BMXSDKConfig([BMXClientType] type, String vsn, String dataDir, String cacheDir, String pushCertName) | |
BMXSDKConfig([BMXClientType] type, String vsn, String dataDir, String cacheDir, String pushCertName, String appId, String appSecret, boolean deliveryAck) | |
BMXSDKConfig([BMXClientType] type, String vsn, String dataDir, String cacheDir, String pushCertName, String appId, String appSecret) | |
String | getDataDir() |
String | getCacheDir() |
[BMXClientType] | getClientType() |
String | getVsn() |
String | getSDKVersion() |
String | getPushCertName() |
void | setPushCertName(String arg0) |
String | getUserAgent() |
boolean | carryUsernameInMessage() |
void | setCarryUsernameInMessage(boolean arg0) |
boolean | enableDeliveryAck() |
void | setEnableDeliveryAck(boolean arg0) |
BMXLogLevel | getLogLevel() |
void | setLogLevel(BMXLogLevel arg0) |
boolean | getConsoleOutput() |
void | setConsoleOutput(boolean arg0) |
void | setHostConfig(BMXSDKConfig.HostConfig config) |
BMXSDKConfig.HostConfig | getHostConfig() |
boolean | getLoadAllServerConversations() |
void | setLoadAllServerConversations(boolean enable) |
void | setLoadAllServerConversations() |
String | getDeviceUuid() |
void | setDeviceUuid(String uuid) |
String | getDBCryptoKey() |
void | setDBCryptoKey(String cryptoKey) |
boolean | getVerifyCertificate() |
void | setVerifyCertificate(boolean verify) |
void | setVerifyCertificate() |
boolean | getEnableDNS() |
void | setEnableDNS(boolean enable) |
void | setEnableDNS() |
String | getUserDNSAddress() |
void | setUserDNSAddress(String dns) |
String | getAppID() |
void | setAppID(String appID) |
String | getAppSecret() |
void | setAppSecret(String appSecret) |
[BMXPushProviderType] | getPushProviderType() |
void | setPushProviderType([BMXPushProviderType] type) |
[BMXPushEnvironmentType] | getPushEnvironmentType() |
void | setEnvironmentType([BMXPushEnvironmentType] type) |
long | getDebugLogReceiverId() |
void | setDebugLogReceiverId(long uid) |
Protected Functions
Name | |
---|---|
BMXSDKConfig(long cPtr, boolean cMemoryOwn) | |
void | finalize() |
long | getCPtr(BMXSDKConfig obj) |
Public Functions Documentation
function delete
inline synchronized void delete()
Example:
function BMXSDKConfig
inline BMXSDKConfig(
BMXClientType type,
String vsn,
String dataDir,
String cacheDir,
String pushCertName,
boolean deliveryAck
)
构造函数
Parameters:
- type 客户端类型
- vsn 客户端OS版本
- dataDir 聊天数据存储路径
- cacheDir 缓存数据存储路径
- pushCertName Push证书名字
- deliveryAck 是否发送消息送达回执
Example:
function BMXSDKConfig
inline BMXSDKConfig(
BMXClientType type,
String vsn,
String dataDir,
String cacheDir,
String pushCertName
)
Example:
function BMXSDKConfig
inline BMXSDKConfig(
BMXClientType type,
String vsn,
String dataDir,
String cacheDir,
String pushCertName,
String appId,
String appSecret,
boolean deliveryAck
)
Example:
function BMXSDKConfig
inline BMXSDKConfig(
BMXClientType type,
String vsn,
String dataDir,
String cacheDir,
String pushCertName,
String appId,
String appSecret
)
Example:
function getDataDir
inline String getDataDir()
Example:
function getCacheDir
inline String getCacheDir()
Example:
function getClientType
inline BMXClientType getClientType()
Example:
function getVsn
inline String getVsn()
Example:
function getSDKVersion
inline String getSDKVersion()
Example:
function getPushCertName
inline String getPushCertName()
Example:
function setPushCertName
inline void setPushCertName(
String arg0
)
Example:
function getUserAgent
inline String getUserAgent()
Example:
function carryUsernameInMessage
inline boolean carryUsernameInMessage()
Example:
function setCarryUsernameInMessage
inline void setCarryUsernameInMessage(
boolean arg0
)
Example:
function enableDeliveryAck
inline boolean enableDeliveryAck()
Example:
function setEnableDeliveryAck
inline void setEnableDeliveryAck(
boolean arg0
)
Example:
function getLogLevel
inline BMXLogLevel getLogLevel()
Example:
function setLogLevel
inline void setLogLevel(
BMXLogLevel arg0
)
Example:
public static void initBMXSDK() {
String appPath = getFilesPath(AppContextUtils.getAppContext());
File dataPath = new File(appPath + "/data_dir");
File cachePath = new File(appPath + "/cache_dir");
dataPath.mkdirs();
cachePath.mkdirs();
String pushId = getPushId();
BMXSDKConfig conf = new BMXSDKConfig(BMXClientType.Android, "1", dataPath.getAbsolutePath(),
cachePath.getAbsolutePath(), TextUtils.isEmpty(pushId) ? "MaxIM" : pushId);
conf.setAppID(SharePreferenceUtils.getInstance().getAppId());
// conf.setAppSecret(ScanConfigs.CODE_SECRET);
conf.setConsoleOutput(true);
conf.setLoadAllServerConversations(true);
conf.setLogLevel(BMXLogLevel.Debug);
conf.setDeviceUuid(RomUtil.getDeviceId());
conf.setEnvironmentType(BMXPushEnvironmentType.Production);
conf.setPushProviderType(getProvideType(AppContextUtils.getAppContext()));
bmxClient = BMXClient.create(conf);
function getConsoleOutput
inline boolean getConsoleOutput()
Example:
function setConsoleOutput
inline void setConsoleOutput(
boolean arg0
)
Example:
public static void initBMXSDK() {
String appPath = getFilesPath(AppContextUtils.getAppContext());
File dataPath = new File(appPath + "/data_dir");
File cachePath = new File(appPath + "/cache_dir");
dataPath.mkdirs();
cachePath.mkdirs();
String pushId = getPushId();
BMXSDKConfig conf = new BMXSDKConfig(BMXClientType.Android, "1", dataPath.getAbsolutePath(),
cachePath.getAbsolutePath(), TextUtils.isEmpty(pushId) ? "MaxIM" : pushId);
conf.setAppID(SharePreferenceUtils.getInstance().getAppId());
// conf.setAppSecret(ScanConfigs.CODE_SECRET);
conf.setConsoleOutput(true);
conf.setLoadAllServerConversations(true);
conf.setLogLevel(BMXLogLevel.Debug);
conf.setDeviceUuid(RomUtil.getDeviceId());
conf.setEnvironmentType(BMXPushEnvironmentType.Production);
conf.setPushProviderType(getProvideType(AppContextUtils.getAppContext()));
bmxClient = BMXClient.create(conf);
function setHostConfig
inline void setHostConfig(
BMXSDKConfig.HostConfig config
)
Example:
hostConfig.getImHost().equals(server) &&
hostConfig.getImPort() == port &&
hostConfig.getRestHost().equals(restServer)){
return;
}
if (!TextUtils.isEmpty(server) && port > 0 && !TextUtils.isEmpty(restServer)) {
// 三项数据都不为空才设置
hostConfig.setImHost(server);
hostConfig.setImPort(port);
hostConfig.setRestHost(restServer);
conf.setHostConfig(hostConfig);
conf.setEnableDNS(false);
} else {
conf.setEnableDNS(true);
}
function getHostConfig
inline BMXSDKConfig.HostConfig getHostConfig()
Example:
public static void changeDNS(String server, int port, String restServer) {
if (bmxClient == null || bmxClient.getSDKConfig() == null) {
return;
}
//Same config of dns enabled
if (bmxClient.getSDKConfig().getEnableDNS() && (TextUtils.isEmpty(server) || port <= 0 || TextUtils.isEmpty(restServer))){
return;
}
BMXSDKConfig conf = bmxClient.getSDKConfig();
BMXSDKConfig.HostConfig hostConfig = conf.getHostConfig();
//Same config of dns disabled
if (!bmxClient.getSDKConfig().getEnableDNS() &&
hostConfig.getImHost().equals(server) &&
hostConfig.getImPort() == port &&
hostConfig.getRestHost().equals(restServer)){
return;
}
if (!TextUtils.isEmpty(server) && port > 0 && !TextUtils.isEmpty(restServer)) {
// 三项数据都不为空才设置
hostConfig.setImHost(server);
function getLoadAllServerConversations
inline boolean getLoadAllServerConversations()
Example:
function setLoadAllServerConversations
inline void setLoadAllServerConversations(
boolean enable
)
Example:
public static void initBMXSDK() {
String appPath = getFilesPath(AppContextUtils.getAppContext());
File dataPath = new File(appPath + "/data_dir");
File cachePath = new File(appPath + "/cache_dir");
dataPath.mkdirs();
cachePath.mkdirs();
String pushId = getPushId();
BMXSDKConfig conf = new BMXSDKConfig(BMXClientType.Android, "1", dataPath.getAbsolutePath(),
cachePath.getAbsolutePath(), TextUtils.isEmpty(pushId) ? "MaxIM" : pushId);
conf.setAppID(SharePreferenceUtils.getInstance().getAppId());
// conf.setAppSecret(ScanConfigs.CODE_SECRET);
conf.setConsoleOutput(true);
conf.setLoadAllServerConversations(true);
conf.setLogLevel(BMXLogLevel.Debug);
conf.setDeviceUuid(RomUtil.getDeviceId());
conf.setEnvironmentType(BMXPushEnvironmentType.Production);
conf.setPushProviderType(getProvideType(AppContextUtils.getAppContext()));
bmxClient = BMXClient.create(conf);
function setLoadAllServerConversations
inline void setLoadAllServerConversations()
Example:
public static void initBMXSDK() {
String appPath = getFilesPath(AppContextUtils.getAppContext());
File dataPath = new File(appPath + "/data_dir");
File cachePath = new File(appPath + "/cache_dir");
dataPath.mkdirs();
cachePath.mkdirs();
String pushId = getPushId();
BMXSDKConfig conf = new BMXSDKConfig(BMXClientType.Android, "1", dataPath.getAbsolutePath(),
cachePath.getAbsolutePath(), TextUtils.isEmpty(pushId) ? "MaxIM" : pushId);
conf.setAppID(SharePreferenceUtils.getInstance().getAppId());
// conf.setAppSecret(ScanConfigs.CODE_SECRET);
conf.setConsoleOutput(true);
conf.setLoadAllServerConversations(true);
conf.setLogLevel(BMXLogLevel.Debug);
conf.setDeviceUuid(RomUtil.getDeviceId());
conf.setEnvironmentType(BMXPushEnvironmentType.Production);
conf.setPushProviderType(getProvideType(AppContextUtils.getAppContext()));
bmxClient = BMXClient.create(conf);
function getDeviceUuid
inline String getDeviceUuid()
Example:
function setDeviceUuid
inline void setDeviceUuid(
String uuid
)
Example:
public static void initBMXSDK() {
String appPath = getFilesPath(AppContextUtils.getAppContext());
File dataPath = new File(appPath + "/data_dir");
File cachePath = new File(appPath + "/cache_dir");
dataPath.mkdirs();
cachePath.mkdirs();
String pushId = getPushId();
BMXSDKConfig conf = new BMXSDKConfig(BMXClientType.Android, "1", dataPath.getAbsolutePath(),
cachePath.getAbsolutePath(), TextUtils.isEmpty(pushId) ? "MaxIM" : pushId);
conf.setAppID(SharePreferenceUtils.getInstance().getAppId());
// conf.setAppSecret(ScanConfigs.CODE_SECRET);
conf.setConsoleOutput(true);
conf.setLoadAllServerConversations(true);
conf.setLogLevel(BMXLogLevel.Debug);
conf.setDeviceUuid(RomUtil.getDeviceId());
conf.setEnvironmentType(BMXPushEnvironmentType.Production);
conf.setPushProviderType(getProvideType(AppContextUtils.getAppContext()));
bmxClient = BMXClient.create(conf);
function getDBCryptoKey
inline String getDBCryptoKey()
Example:
function setDBCryptoKey
inline void setDBCryptoKey(
String cryptoKey
)
Example:
function getVerifyCertificate
inline boolean getVerifyCertificate()
Example:
function setVerifyCertificate
inline void setVerifyCertificate(
boolean verify
)
Example:
function setVerifyCertificate
inline void setVerifyCertificate()
Example:
function getEnableDNS
inline boolean getEnableDNS()
Example:
function setEnableDNS
inline void setEnableDNS(
boolean enable
)
Example:
hostConfig.getImPort() == port &&
hostConfig.getRestHost().equals(restServer)){
return;
}
if (!TextUtils.isEmpty(server) && port > 0 && !TextUtils.isEmpty(restServer)) {
// 三项数据都不为空才设置
hostConfig.setImHost(server);
hostConfig.setImPort(port);
hostConfig.setRestHost(restServer);
conf.setHostConfig(hostConfig);
conf.setEnableDNS(false);
} else {
conf.setEnableDNS(true);
}
return;
}
if (!TextUtils.isEmpty(server) && port > 0 && !TextUtils.isEmpty(restServer)) {
// 三项数据都不为空才设置
hostConfig.setImHost(server);
hostConfig.setImPort(port);
hostConfig.setRestHost(restServer);
conf.setHostConfig(hostConfig);
conf.setEnableDNS(false);
} else {
conf.setEnableDNS(true);
}
function setEnableDNS
inline void setEnableDNS()
Example:
hostConfig.getImPort() == port &&
hostConfig.getRestHost().equals(restServer)){
return;
}
if (!TextUtils.isEmpty(server) && port > 0 && !TextUtils.isEmpty(restServer)) {
// 三项数据都不为空才设置
hostConfig.setImHost(server);
hostConfig.setImPort(port);
hostConfig.setRestHost(restServer);
conf.setHostConfig(hostConfig);
conf.setEnableDNS(false);
} else {
conf.setEnableDNS(true);
}
return;
}
if (!TextUtils.isEmpty(server) && port > 0 && !TextUtils.isEmpty(restServer)) {
// 三项数据都不为空才设置
hostConfig.setImHost(server);
hostConfig.setImPort(port);
hostConfig.setRestHost(restServer);
conf.setHostConfig(hostConfig);
conf.setEnableDNS(false);
} else {
conf.setEnableDNS(true);
}
function getUserDNSAddress
inline String getUserDNSAddress()
Example:
function setUserDNSAddress
inline void setUserDNSAddress(
String dns
)
Example:
function getAppID
inline String getAppID()
Example:
function setAppID
inline void setAppID(
String appID
)
Example:
public static void initBMXSDK() {
String appPath = getFilesPath(AppContextUtils.getAppContext());
File dataPath = new File(appPath + "/data_dir");
File cachePath = new File(appPath + "/cache_dir");
dataPath.mkdirs();
cachePath.mkdirs();
String pushId = getPushId();
BMXSDKConfig conf = new BMXSDKConfig(BMXClientType.Android, "1", dataPath.getAbsolutePath(),
cachePath.getAbsolutePath(), TextUtils.isEmpty(pushId) ? "MaxIM" : pushId);
conf.setAppID(SharePreferenceUtils.getInstance().getAppId());
// conf.setAppSecret(ScanConfigs.CODE_SECRET);
conf.setConsoleOutput(true);
conf.setLoadAllServerConversations(true);
conf.setLogLevel(BMXLogLevel.Debug);
conf.setDeviceUuid(RomUtil.getDeviceId());
conf.setEnvironmentType(BMXPushEnvironmentType.Production);
conf.setPushProviderType(getProvideType(AppContextUtils.getAppContext()));
bmxClient = BMXClient.create(conf);
function getAppSecret
inline String getAppSecret()
Example:
function setAppSecret
inline void setAppSecret(
String appSecret
)
Example:
function getPushProviderType
inline BMXPushProviderType getPushProviderType()
Example:
function setPushProviderType
inline void setPushProviderType(
BMXPushProviderType type
)
Example:
public static void initBMXSDK() {
String appPath = getFilesPath(AppContextUtils.getAppContext());
File dataPath = new File(appPath + "/data_dir");
File cachePath = new File(appPath + "/cache_dir");
dataPath.mkdirs();
cachePath.mkdirs();
String pushId = getPushId();
BMXSDKConfig conf = new BMXSDKConfig(BMXClientType.Android, "1", dataPath.getAbsolutePath(),
cachePath.getAbsolutePath(), TextUtils.isEmpty(pushId) ? "MaxIM" : pushId);
conf.setAppID(SharePreferenceUtils.getInstance().getAppId());
// conf.setAppSecret(ScanConfigs.CODE_SECRET);
conf.setConsoleOutput(true);
conf.setLoadAllServerConversations(true);
conf.setLogLevel(BMXLogLevel.Debug);
conf.setDeviceUuid(RomUtil.getDeviceId());
conf.setEnvironmentType(BMXPushEnvironmentType.Production);
conf.setPushProviderType(getProvideType(AppContextUtils.getAppContext()));
bmxClient = BMXClient.create(conf);
function getPushEnvironmentType
inline BMXPushEnvironmentType getPushEnvironmentType()
Example:
function setEnvironmentType
inline void setEnvironmentType(
BMXPushEnvironmentType type
)
Example:
public static void initBMXSDK() {
String appPath = getFilesPath(AppContextUtils.getAppContext());
File dataPath = new File(appPath + "/data_dir");
File cachePath = new File(appPath + "/cache_dir");
dataPath.mkdirs();
cachePath.mkdirs();
String pushId = getPushId();
BMXSDKConfig conf = new BMXSDKConfig(BMXClientType.Android, "1", dataPath.getAbsolutePath(),
cachePath.getAbsolutePath(), TextUtils.isEmpty(pushId) ? "MaxIM" : pushId);
conf.setAppID(SharePreferenceUtils.getInstance().getAppId());
// conf.setAppSecret(ScanConfigs.CODE_SECRET);
conf.setConsoleOutput(true);
conf.setLoadAllServerConversations(true);
conf.setLogLevel(BMXLogLevel.Debug);
conf.setDeviceUuid(RomUtil.getDeviceId());
conf.setEnvironmentType(BMXPushEnvironmentType.Production);
conf.setPushProviderType(getProvideType(AppContextUtils.getAppContext()));
bmxClient = BMXClient.create(conf);
function getDebugLogReceiverId
inline long getDebugLogReceiverId()
Example:
function setDebugLogReceiverId
inline void setDebugLogReceiverId(
long uid
)
Protected Functions Documentation
Example:
function BMXSDKConfig
inline BMXSDKConfig(
long cPtr,
boolean cMemoryOwn
)
Example:
function finalize
inline void finalize()
Example:
function getCPtr
static inline long getCPtr(
BMXSDKConfig obj
)
Example:
Updated on 2022-01-26 at 17:18:31 +0800