File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed
src/cn/jpush/api/examples Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change 2020<dependency>
2121 <groupId>cn.jpush.api</groupId>
2222 <artifactId>jpush-client</artifactId>
23- <version>3.0.1 </version>
23+ <version>3.0.0 </version>
2424</dependency>
2525```
2626### jar 包方式
@@ -150,7 +150,7 @@ maven package
150150 }
151151```
152152
153- * 构建推送对象:平台是 iOS,推送目标是 "tag1", "tag_all" 的并集,推送内容同时包括通知与消息 - 通知信息是 ALERT,并且附加字段 from = "JPush";消息内容是 MSG_CONTENT。通知是 APNs 推送通道的,消息是 JPush 应用内消息通道的。
153+ * 构建推送对象:平台是 iOS,推送目标是 "tag1", "tag_all" 的并集,推送内容同时包括通知与消息 - 通知信息是 ALERT,角标数字为 1,通知声音为 "happy", 并且附加字段 from = "JPush";消息内容是 MSG_CONTENT。通知是 APNs 推送通道的,消息是 JPush 应用内消息通道的。
154154
155155```
156156 public static PushPayload buildPushObject_ios_tagAnd_alertWithExtrasAndMessage() {
@@ -160,6 +160,8 @@ maven package
160160 .setNotification(Notification.newBuilder()
161161 .addPlatformNotification(IosNotification.newBuilder()
162162 .setAlert(ALERT)
163+ .setBadge(1)
164+ .setSound("happy")
163165 .addExtra("from", "JPush")
164166 .build())
165167 .build())
Original file line number Diff line number Diff line change @@ -83,7 +83,9 @@ public static PushPayload buildPushObject_ios_tagAnd_alertWithExtrasAndMessage()
8383 .setNotification (Notification .newBuilder ()
8484 .addPlatformNotification (IosNotification .newBuilder ()
8585 .setAlert (ALERT )
86- .addExtra ("news_id" , 333 )
86+ .setBadge (1 )
87+ .setSound ("happy" )
88+ .addExtra ("from" , "JPush" )
8789 .build ())
8890 .build ())
8991 .setMessage (Message .content (MSG_CONTENT ))
@@ -99,7 +101,7 @@ public static PushPayload buildPushObject_ios_audienceMore_messageWithExtras() {
99101 .build ())
100102 .setMessage (Message .newBuilder ()
101103 .setMsgContent (MSG_CONTENT )
102- .addExtra ("news_id " , 333 )
104+ .addExtra ("from " , "JPush" )
103105 .build ())
104106 .build ();
105107 }
You can’t perform that action at this time.
0 commit comments