NIMSDK-AOS  10.9.43
StatusBarNotificationConfig.java
浏览该文件的文档.
1 package com.netease.nimlib.sdk;
2 
3 import android.Manifest;
4 import android.app.Activity;
5 import android.app.NotificationManager;
7 import java.io.Serializable;
8 
9 /**
10  * SDK提供状态栏提醒的配置
11  */
12 @SuppressWarnings("java:S1104")
13 public class StatusBarNotificationConfig implements Serializable {
14 
15  /**
16  * 状态栏提醒的小图标的资源ID。<br>
17  * 如果不提供,使用app的icon
18  */
20 
21  /**
22  * 是否需要响铃提醒。<br>
23  * 默认为true
24  */
25  public boolean ring = true;
26 
27  /**
28  * 响铃提醒的声音资源,如果不提供,使用系统默认提示音。
29  */
30  public String notificationSound;
31 
32  /**
33  * 是否需要振动提醒。<br>
34  * 默认为true
35  */
36  public boolean vibrate = true;
37 
38  /**
39  * 呼吸灯的颜色
40  * The color of the led. The hardware will do its best approximation.
41  * 建议尽量使用绿色、蓝色、红色等基本颜色,不要去用混合色。
42  */
43  public int ledARGB = -1;
44 
45  /**
46  * 呼吸灯亮时的持续时间(毫秒)
47  * The number of milliseconds for the LED to be on while it's flashing.
48  * The hardware will do its best approximation.
49  */
50  public int ledOnMs = -1;
51 
52  /**
53  * 呼吸灯熄灭时的持续时间(毫秒)
54  * The number of milliseconds for the LED to be off while it's flashing.
55  * The hardware will do its best approximation.
56  */
57  public int ledOffMs = -1;
58 
59  /**
60  * 不显示消息详情开关, 同时也不再显示消息发送者昵称<br>
61  * 默认为false
62  */
63  public boolean hideContent = false;
64 
65 
66  /**
67  * 免打扰设置开关。默认为关闭。
68  */
69  public boolean downTimeToggle = false;
70 
71 
72  /**
73  * 免打扰的开始时间, 格式为HH:mm(24小时制)。
74  */
75  public String downTimeBegin;
76 
77 
78  /**
79  * 免打扰的结束时间, 格式为HH:mm(24小时制)。<br>
80  * 如果结束时间小于开始时间,免打扰时间为开始时间-24:00-结束时间。
81  */
82  public String downTimeEnd;
83 
84  /**
85  * 免打扰期间,是否显示通知,默认为显示
86  */
87  public boolean downTimeEnableNotification = true;
88 
89 
90  /**
91  * 通知栏提醒的响应intent的activity类型。<br>
92  * 可以为null。如果未提供,将使用包的launcher的入口intent的activity。
93  */
94  public Class<? extends Activity> notificationEntrance;
95 
96  /**
97  * 通知栏提醒的标题是否只显示应用名。默认是 false,当有一个会话发来消息时,显示会话名;当有多个会话发来时,显示应用名。
98  * 修改为true,那么无论一个还是多个会话发来消息,标题均显示应用名。
99  * 应用名称请在AndroidManifest的application节点下设置android:label。
100  */
101  public boolean titleOnlyShowAppName = false;
102 
103  /**
104  * 该字段已废弃
105  *
106  * @see NotificationFoldStyle
107  */
108  @Deprecated
109  public boolean notificationFolded = true;
110 
111  /**
112  * 消息通知栏的折叠类型,不配置时,以notificationFolded的值为准, 如果为null,表示默认所有折叠
113  */
114  public NotificationFoldStyle notificationFoldStyle = NotificationFoldStyle.ALL;
115 
116  /**
117  * 消息通知栏颜色,将应用到 NotificationCompat.Builder 的 setColor 方法
118  * 对Android 5.0 以后机型会影响到smallIcon
119  */
120  public int notificationColor;
121 
122  /**
123  * 是否APP图标显示未读数(红点)
124  * 仅针对Android 8.0+有效
125  */
126  public boolean showBadge = true;
127 
128  /**
129  * 如果群名称为null 或者空串,则使用customTitleWhenTeamNameEmpty 作为通知栏title
130  */
132 
133  /**
134  * 点击通知栏传递的extra类型
135  */
137 
138  /**
139  * 弹StatusBarNotification之前,SDK通过改接口询问App,根据App返回结果决定是否弹出通知
140  * 为空等同于返回DEFAULT
141  */
142  public StatusBarNotificationFilter notificationFilter = null;
143  /**
144  * Android13 弹出通知之前,SDK通过改接口向App请求权限{@link Manifest.permission#POST_NOTIFICATIONS},根据权限赋予结果决定是否弹出通知
145  */
146  public NimPermissionRequester postNotificationsRequester = null;
147  /**
148  * 是否开启高优先级通知{@link NotificationManager#IMPORTANCE_HIGH},仅针对Android 8.0+有效
149  */
150  public boolean highImportance = false;
151 
152 }
String customTitleWhenTeamNameEmpty
如果群名称为null 或者空串,则使用customTitleWhenTeamNameEmpty 作为通知栏title
ALL
折叠所有通知栏消息为一条通知
int notificationColor
消息通知栏颜色,将应用到 NotificationCompat.Builder 的 setColor 方法 对Android 5.0 以后机型会影响到sm...
Class<?extends Activity > notificationEntrance
通知栏提醒的响应intent的activity类型。 可以为null。如果未提供,将使用包的launcher的入口intent的activ...
String downTimeBegin
免打扰的开始时间, 格式为HH:mm(24小时制)。
int notificationSmallIconId
状态栏提醒的小图标的资源ID。 如果不提供,使用app的icon
String notificationSound
响铃提醒的声音资源,如果不提供,使用系统默认提示音。
String downTimeEnd
免打扰的结束时间, 格式为HH:mm(24小时制)。 如果结束时间小于开始时间,免打扰时间为开始时间-24:00-结束...