File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
example/main/java/cn/jpush/api/examples Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change 1313import cn .jpush .api .push .model .PushPayload ;
1414import cn .jpush .api .push .model .audience .Audience ;
1515import cn .jpush .api .push .model .audience .AudienceTarget ;
16+ import cn .jpush .api .push .model .notification .AndroidNotification ;
1617import cn .jpush .api .push .model .notification .IosNotification ;
1718import cn .jpush .api .push .model .notification .Notification ;
1819
@@ -78,6 +79,21 @@ public static PushPayload buildPushObject_android_tag_alertWithTitle() {
7879 .build ();
7980 }
8081
82+ public static PushPayload buildPushObject_android_and_ios () {
83+ return PushPayload .newBuilder ()
84+ .setPlatform (Platform .android_ios ())
85+ .setAudience (Audience .tag ("tag1" ))
86+ .setNotification (Notification .newBuilder ()
87+ .setAlert ("alert content" )
88+ .addPlatformNotification (AndroidNotification .newBuilder ()
89+ .setTitle ("Android Title" ).build ())
90+ .addPlatformNotification (IosNotification .newBuilder ()
91+ .incrBadge (1 )
92+ .addExtra ("extra_key" , "extra_value" ).build ())
93+ .build ())
94+ .build ();
95+ }
96+
8197 public static PushPayload buildPushObject_ios_tagAnd_alertWithExtrasAndMessage () {
8298 return PushPayload .newBuilder ()
8399 .setPlatform (Platform .ios ())
You can’t perform that action at this time.
0 commit comments