Skip to content

Commit 0583990

Browse files
author
Javen
committed
Fix bug: lack of content-availbe property options.
1 parent 8d0c863 commit 0583990

File tree

1 file changed

+26
-9
lines changed

1 file changed

+26
-9
lines changed

src/cn/jpush/api/push/IosExtras.java

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,30 @@
11
package cn.jpush.api.push;
22

3+
import com.google.gson.annotations.SerializedName;
4+
35
/*
46
* Should be set into Notification extras with key "ios"
57
*/
68
public class IosExtras {
79

8-
public IosExtras(int badge, String sound) {
10+
private int badge = 0;
11+
12+
private String sound = "";
13+
14+
@SerializedName("content-available")
15+
private boolean contentAvailable = false;
16+
17+
public IosExtras(int badge, String sound, boolean contentAvailable) {
918
this.badge = badge;
1019
this.sound = sound;
20+
this.contentAvailable = contentAvailable;
1121
}
1222

23+
public IosExtras(int badge, String sound) {
24+
this.badge = badge;
25+
this.sound = sound;
26+
}
27+
1328
public IosExtras(String sound) {
1429
this.sound = sound;
1530
}
@@ -18,13 +33,6 @@ public IosExtras(int badge) {
1833
this.badge = badge;
1934
}
2035

21-
/*
22-
* Badge Notification,默认是(0)
23-
*/
24-
private int badge = 0;
25-
26-
private String sound = "";
27-
2836
public int getBadge() {
2937
return badge;
3038
}
@@ -39,7 +47,16 @@ public String getSound() {
3947

4048
public void setSound(String sound) {
4149
this.sound = sound;
42-
}
50+
}
51+
52+
public boolean isContentAvailable() {
53+
return contentAvailable;
54+
}
55+
56+
public void setContentAvailable(boolean contentAvailable) {
57+
this.contentAvailable = contentAvailable;
58+
}
59+
4360

4461
}
4562

0 commit comments

Comments
 (0)