NIMSDK-AOS 10.2.6-beta
|
SDK nos token场景配置,不配置的话,走默认值,默认值只有以下3种场景: 更多...
Public 成员函数 | |
NosTokenSceneConfig () | |
int | getMaxCustomNosSceneCount () |
获取自定义NOS场景最大数量 更多... | |
void | updateDefaultProfileSceneExpireTime (int expireTime) |
更新默认场景 NimNosSceneKeyConstant#NIM_DEFAULT_PROFILE 对应的过期时间 更多... | |
void | updateDefaultIMSceneExpireTime (int expireTime) |
更新默认场景 NimNosSceneKeyConstant#NIM_DEFAULT_IM 对应的过期时间 更多... | |
NosTokenSceneConfig | appendCustomScene (String sceneKey, int expireTime) |
增加自定义场景 更多... | |
NosTokenSceneConfig | appendCustomSceneByMilliseconds (String sceneKey, long expireTime) |
HashMap< String, Long > | getNosTokenScene () |
获取所有场景副本 更多... | |
静态 Public 成员函数 | |
static NosTokenSceneConfig | defaultConfig () |
静态 Public 属性 | |
static final long | NEVER_EXPIRE = 0L |
永不过期,资源一直在于服务器 更多... | |
static final long | DAY_SECOND = 60 * 60 * 24L |
SDK nos token场景配置,不配置的话,走默认值,默认值只有以下3种场景:
默认场景对应的默认过期时间为NEVER_EXPIRE
,用户可以修改默认场景的过期时间。 同时用户可以新增自己的场景并指定对应的过期时间(sceneKey-> expireTimeByDay),目前最多10个.
用户发送消息或直接上传文件等情况下都可以任意指定相应的场景 ,不指定走默认的。 如果要指定相应的场景,只需要指定相应的sceneKey 即可
强烈建议在配置时,将相应的sceneKey常量化,以方便使用,参考NimNosSceneKeyConstant
在文件 NosTokenSceneConfig.java 第 25 行定义.
com.netease.nimlib.sdk.NosTokenSceneConfig.NosTokenSceneConfig | ( | ) |
在文件 NosTokenSceneConfig.java 第 53 行定义.
NosTokenSceneConfig com.netease.nimlib.sdk.NosTokenSceneConfig.appendCustomScene | ( | String | sceneKey, |
int | expireTime | ||
) |
增加自定义场景
sceneKey | 自定义场景key,使用时需要带上相应的sceneKey |
expireTime | 过期时间,0表示永不过期,单位: 天 |
在文件 NosTokenSceneConfig.java 第 100 行定义.
NosTokenSceneConfig com.netease.nimlib.sdk.NosTokenSceneConfig.appendCustomSceneByMilliseconds | ( | String | sceneKey, |
long | expireTime | ||
) |
在文件 NosTokenSceneConfig.java 第 104 行定义.
|
static |
在文件 NosTokenSceneConfig.java 第 129 行定义.
int com.netease.nimlib.sdk.NosTokenSceneConfig.getMaxCustomNosSceneCount | ( | ) |
HashMap< String, Long > com.netease.nimlib.sdk.NosTokenSceneConfig.getNosTokenScene | ( | ) |
void com.netease.nimlib.sdk.NosTokenSceneConfig.updateDefaultIMSceneExpireTime | ( | int | expireTime | ) |
更新默认场景 NimNosSceneKeyConstant#NIM_DEFAULT_IM
对应的过期时间
expireTime | 过期时间,0表示永不过期,单位: 天 |
在文件 NosTokenSceneConfig.java 第 85 行定义.
void com.netease.nimlib.sdk.NosTokenSceneConfig.updateDefaultProfileSceneExpireTime | ( | int | expireTime | ) |
更新默认场景 NimNosSceneKeyConstant#NIM_DEFAULT_PROFILE
对应的过期时间
expireTime | 过期时间,0表示永不过期,单位: 天 |
在文件 NosTokenSceneConfig.java 第 72 行定义.
|
static |
在文件 NosTokenSceneConfig.java 第 32 行定义.
|
static |
永不过期,资源一直在于服务器
在文件 NosTokenSceneConfig.java 第 30 行定义.