NIMSDK-AOS 10.2.6-beta
载入中...
搜索中...
未找到
Public 成员函数 | 静态 Public 成员函数 | 静态 Public 属性 | 所有成员列表
com.netease.nimlib.sdk.NosTokenSceneConfig类 参考

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种场景:

参见
NimNosSceneKeyConstant::NIM_DEFAULT_PROFILE
NimNosSceneKeyConstant::NIM_DEFAULT_IM
NimNosSceneKeyConstant::NIM_SYSTEM_NOS_SCENE

默认场景对应的默认过期时间为NEVER_EXPIRE,用户可以修改默认场景的过期时间。 同时用户可以新增自己的场景并指定对应的过期时间(sceneKey-> expireTimeByDay),目前最多10个.

用户发送消息或直接上传文件等情况下都可以任意指定相应的场景 ,不指定走默认的。 如果要指定相应的场景,只需要指定相应的sceneKey 即可

强烈建议在配置时,将相应的sceneKey常量化,以方便使用,参考NimNosSceneKeyConstant

在文件 NosTokenSceneConfig.java25 行定义.

构造及析构函数说明

◆ NosTokenSceneConfig()

com.netease.nimlib.sdk.NosTokenSceneConfig.NosTokenSceneConfig ( )

在文件 NosTokenSceneConfig.java53 行定义.

成员函数说明

◆ appendCustomScene()

NosTokenSceneConfig com.netease.nimlib.sdk.NosTokenSceneConfig.appendCustomScene ( String  sceneKey,
int  expireTime 
)

增加自定义场景

参数
sceneKey自定义场景key,使用时需要带上相应的sceneKey
expireTime过期时间,0表示永不过期,单位: 天
返回
NosTokenSceneConfig

在文件 NosTokenSceneConfig.java100 行定义.

◆ appendCustomSceneByMilliseconds()

NosTokenSceneConfig com.netease.nimlib.sdk.NosTokenSceneConfig.appendCustomSceneByMilliseconds ( String  sceneKey,
long  expireTime 
)

在文件 NosTokenSceneConfig.java104 行定义.

◆ defaultConfig()

static NosTokenSceneConfig com.netease.nimlib.sdk.NosTokenSceneConfig.defaultConfig ( )
static

在文件 NosTokenSceneConfig.java129 行定义.

◆ getMaxCustomNosSceneCount()

int com.netease.nimlib.sdk.NosTokenSceneConfig.getMaxCustomNosSceneCount ( )

获取自定义NOS场景最大数量

返回

在文件 NosTokenSceneConfig.java62 行定义.

◆ getNosTokenScene()

HashMap< String, Long > com.netease.nimlib.sdk.NosTokenSceneConfig.getNosTokenScene ( )

获取所有场景副本

返回
包含所有场景的HashMap

在文件 NosTokenSceneConfig.java123 行定义.

◆ updateDefaultIMSceneExpireTime()

void com.netease.nimlib.sdk.NosTokenSceneConfig.updateDefaultIMSceneExpireTime ( int  expireTime)

更新默认场景 NimNosSceneKeyConstant#NIM_DEFAULT_IM对应的过期时间

参数
expireTime过期时间,0表示永不过期,单位: 天
返回
NosTokenSceneConfig

在文件 NosTokenSceneConfig.java85 行定义.

◆ updateDefaultProfileSceneExpireTime()

void com.netease.nimlib.sdk.NosTokenSceneConfig.updateDefaultProfileSceneExpireTime ( int  expireTime)

更新默认场景 NimNosSceneKeyConstant#NIM_DEFAULT_PROFILE对应的过期时间

参数
expireTime过期时间,0表示永不过期,单位: 天
返回
NosTokenSceneConfig

在文件 NosTokenSceneConfig.java72 行定义.

类成员变量说明

◆ DAY_SECOND

final long com.netease.nimlib.sdk.NosTokenSceneConfig.DAY_SECOND = 60 * 60 * 24L
static

在文件 NosTokenSceneConfig.java32 行定义.

◆ NEVER_EXPIRE

final long com.netease.nimlib.sdk.NosTokenSceneConfig.NEVER_EXPIRE = 0L
static

永不过期,资源一直在于服务器

在文件 NosTokenSceneConfig.java30 行定义.


该类的文档由以下文件生成: