diff --git a/README.md b/README.md index 00d10486..70ccabde 100644 --- a/README.md +++ b/README.md @@ -18,13 +18,13 @@ ## 安装 ### maven 方式 -将下边的依赖条件放到你项目的 maven pom.xml 文件里。 +将下边的依赖条件放到你项目的 maven pom.xml 文件里。v3.3.10 为例,最新版本请看[Release页面](https://github.com/jpush/jpush-api-java-client/releases) ```Java cn.jpush.api jpush-client - 3.3.9 + 3.3.10 ``` ### jar 包方式 @@ -33,6 +33,7 @@ ### 依赖包 +* [jiguang-java-client-common](https://github.com/jpush/jiguang-java-client-common) / 极光 Java client 的公共封装开发包,必须依赖,v1.1.4 为例,查看[最新版本](https://github.com/jpush/jiguang-java-client-common/releases) * [slf4j](http://www.slf4j.org/) / log4j (Logger) * [gson](https://code.google.com/p/google-gson/) (Google JSON Utils) @@ -44,7 +45,7 @@ cn.jpush.api jiguang-common - 1.1.3 + 1.1.4 io.netty diff --git a/pom.xml b/pom.xml index 58fc4a1d..8269a102 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ cn.jpush.api jpush-client - 3.3.10-SNAPSHOT + 3.3.11-SNAPSHOT jar https://github.com/jpush/jpush-api-java-client JPush API Java Client diff --git a/src/main/java/cn/jpush/api/push/model/notification/IosNotification.java b/src/main/java/cn/jpush/api/push/model/notification/IosNotification.java index 95b27f96..c00c3b3e 100644 --- a/src/main/java/cn/jpush/api/push/model/notification/IosNotification.java +++ b/src/main/java/cn/jpush/api/push/model/notification/IosNotification.java @@ -17,6 +17,9 @@ *
  • badge: 支持 setBadge(int) 方法来设置;支持 incrBadge(int) 方法来增加。
  • *
  • sound: 支持 setSound(string) 方法来设置声音文件。或者 setSound(JSON object) 对应官方payload结构
  • *
  • content-available: 用来支持后台推送。如果该值赋值为 1,表示开启后台推送。
  • + *
  • mutable-content: 通知扩展
  • + *
  • category: IOS 8 才支持。设置 APNs payload 中的 "category" 字段值
  • + *
  • mutable-content: 通知扩展
  • *
  • extras: JSON object. 支持更多的自定义字段信息。
  • * *
    @@ -37,6 +40,7 @@ public class IosNotification extends PlatformNotification { private static final String CONTENT_AVAILABLE = "content-available"; private static final String MUTABLE_CONTENT = "mutable-content"; private static final String CATEGORY = "category"; + private static final String THREAD_ID = "thread-id"; private static final String ALERT_VALID_BADGE = "Badge number should be 0~99999, " + "and can be prefixed with + to add, - to minus"; @@ -49,11 +53,12 @@ public class IosNotification extends PlatformNotification { private final boolean contentAvailable; private final String category; private final boolean mutableContent; + private final String threadId; private IosNotification(Object alert, Object sound, String badge, boolean contentAvailable, boolean soundDisabled, boolean badgeDisabled, - String category, boolean mutableContent, + String category, boolean mutableContent,String threadId, Map extras, Map numberExtras, Map booleanExtras, @@ -67,6 +72,7 @@ private IosNotification(Object alert, Object sound, String badge, this.badgeDisabled = badgeDisabled; this.category = category; this.mutableContent = mutableContent; + this.threadId = threadId; } public static Builder newBuilder() { @@ -115,6 +121,9 @@ public JsonElement toJSON() { if (mutableContent) { json.add(MUTABLE_CONTENT, new JsonPrimitive(true)); } + if (null != threadId) { + json.add(THREAD_ID, new JsonPrimitive(threadId)); + } return json; } @@ -128,6 +137,7 @@ public static class Builder extends PlatformNotification.Builder