@@ -286,6 +286,10 @@ public static void buildPushObject_with_extra() {
286
286
}
287
287
288
288
public static PushPayload buildPushObject_ios_tagAnd_alertWithExtrasAndMessage () {
289
+ JsonObject sound = new JsonObject ();
290
+ sound .add ("critical" , new JsonPrimitive (1 ));
291
+ sound .add ("name" , new JsonPrimitive ("default" ));
292
+ sound .add ("volume" , new JsonPrimitive (0.2 ));
289
293
return PushPayload .newBuilder ()
290
294
.setPlatform (Platform .ios ())
291
295
.setAudience (Audience .tag_and ("tag1" , "tag_all" ))
@@ -294,7 +298,8 @@ public static PushPayload buildPushObject_ios_tagAnd_alertWithExtrasAndMessage()
294
298
.setAlert (ALERT )
295
299
.setBadge (5 )
296
300
.setMutableContent (false )
297
- .setSound ("happy" )
301
+ // .setSound("happy")
302
+ .setSound (sound )
298
303
.addExtra ("from" , "JPush" )
299
304
.build ())
300
305
.build ())
@@ -306,11 +311,16 @@ public static PushPayload buildPushObject_ios_tagAnd_alertWithExtrasAndMessage()
306
311
}
307
312
308
313
public static PushPayload buildPushObject_android_newly_support () {
314
+
309
315
JsonObject inbox = new JsonObject ();
310
316
inbox .add ("line1" , new JsonPrimitive ("line1 string" ));
311
317
inbox .add ("line2" , new JsonPrimitive ("line2 string" ));
312
318
inbox .add ("contentTitle" , new JsonPrimitive ("title string" ));
313
319
inbox .add ("summaryText" , new JsonPrimitive ("+3 more" ));
320
+
321
+ JsonObject intent = new JsonObject ();
322
+ intent .add ("url" , new JsonPrimitive ("intent:#Intent;component=com.jiguang.push/com.example.jpushdemo.SettingActivity;end" ));
323
+
314
324
Notification notification = Notification .newBuilder ()
315
325
.addPlatformNotification (AndroidNotification .newBuilder ()
316
326
.setAlert (ALERT )
@@ -322,6 +332,8 @@ public static PushPayload buildPushObject_android_newly_support() {
322
332
.setStyle (1 )
323
333
.setTitle ("Alert test" )
324
334
.setPriority (1 )
335
+ .setLargeIcon ("http://www.jiguang.cn/largeIcon.jpg" )
336
+ .setIntent (intent )
325
337
.build ())
326
338
.build ();
327
339
return PushPayload .newBuilder ()
0 commit comments