@@ -47,16 +47,31 @@ public class ApnsInfo implements Serializable {
4747 @ JsonProperty ("MutableContent" )
4848 private Integer mutableContent ;
4949
50+ /**
51+ * IOS 15+ 的推送通知级别,取值只能是 active、critical、passive、time-sensitive 中的一个
52+ */
53+ @ JsonProperty ("InterruptionLevel" )
54+ private String interruptionLevel ;
55+
56+ /**
57+ * 为 1 表示是 IOS 静默推送,无通知栏弹窗,苹果建议1小时最多推送3条静默消息。
58+ */
59+ @ JsonProperty ("ContentAvailable" )
60+ private Integer contentAvailable ;
61+
5062 public ApnsInfo () {
5163 }
5264
53- public ApnsInfo (String sound , Integer badgeMode , String title , String subTitle , String image , Integer mutableContent ) {
65+ public ApnsInfo (String sound , Integer badgeMode , String title , String subTitle ,
66+ String image , Integer mutableContent , String interruptionLevel , Integer contentAvailable ) {
5467 this .sound = sound ;
5568 this .badgeMode = badgeMode ;
5669 this .title = title ;
5770 this .subTitle = subTitle ;
5871 this .image = image ;
5972 this .mutableContent = mutableContent ;
73+ this .interruptionLevel = interruptionLevel ;
74+ this .contentAvailable = contentAvailable ;
6075 }
6176
6277 private ApnsInfo (Builder builder ) {
@@ -66,6 +81,8 @@ private ApnsInfo(Builder builder) {
6681 this .subTitle = builder .subTitle ;
6782 this .image = builder .image ;
6883 this .mutableContent = builder .mutableContent ;
84+ this .interruptionLevel = builder .interruptionLevel ;
85+ this .contentAvailable = builder .contentAvailable ;
6986 }
7087
7188 public static Builder builder () {
@@ -120,6 +137,22 @@ public void setMutableContent(Integer mutableContent) {
120137 this .mutableContent = mutableContent ;
121138 }
122139
140+ public String getInterruptionLevel () {
141+ return interruptionLevel ;
142+ }
143+
144+ public void setInterruptionLevel (String interruptionLevel ) {
145+ this .interruptionLevel = interruptionLevel ;
146+ }
147+
148+ public Integer getContentAvailable () {
149+ return contentAvailable ;
150+ }
151+
152+ public void setContentAvailable (Integer contentAvailable ) {
153+ this .contentAvailable = contentAvailable ;
154+ }
155+
123156
124157 public static final class Builder {
125158 private String sound ;
@@ -128,6 +161,8 @@ public static final class Builder {
128161 private String subTitle ;
129162 private String image ;
130163 private Integer mutableContent ;
164+ private String interruptionLevel ;
165+ private Integer contentAvailable ;
131166
132167 private Builder () {
133168 }
@@ -165,5 +200,15 @@ public Builder mutableContent(Integer mutableContent) {
165200 this .mutableContent = mutableContent ;
166201 return this ;
167202 }
203+
204+ public Builder interruptionLevel (String interruptionLevel ) {
205+ this .interruptionLevel = interruptionLevel ;
206+ return this ;
207+ }
208+
209+ public Builder contentAvailable (Integer contentAvailable ) {
210+ this .contentAvailable = contentAvailable ;
211+ return this ;
212+ }
168213 }
169214}
0 commit comments