88import cn .jpush .api .common .APIRequestException ;
99import cn .jpush .api .push .PushResult ;
1010import cn .jpush .api .push .model .Message ;
11+ import cn .jpush .api .push .model .Options ;
1112import cn .jpush .api .push .model .Platform ;
1213import cn .jpush .api .push .model .PushPayload ;
1314import cn .jpush .api .push .model .audience .Audience ;
1415import cn .jpush .api .push .model .audience .AudienceTarget ;
15- import cn .jpush .api .push .model .notification .AndroidNotification ;
1616import cn .jpush .api .push .model .notification .IosNotification ;
1717import cn .jpush .api .push .model .notification .Notification ;
1818
@@ -71,12 +71,7 @@ public static PushPayload buildPushObject_android_tag_alertWithTitle() {
7171 return PushPayload .newBuilder ()
7272 .setPlatform (Platform .android ())
7373 .setAudience (Audience .tag ("tag1" ))
74- .setNotification (Notification .newBuilder ()
75- .addPlatformNotification (AndroidNotification .newBuilder ()
76- .setAlert (ALERT )
77- .setTitle (TITLE )
78- .build ())
79- .build ())
74+ .setNotification (Notification .android (ALERT , TITLE , null ))
8075 .build ();
8176 }
8277
@@ -87,12 +82,15 @@ public static PushPayload buildPushObject_ios_tagAnd_alertWithExtrasAndMessage()
8782 .setNotification (Notification .newBuilder ()
8883 .addPlatformNotification (IosNotification .newBuilder ()
8984 .setAlert (ALERT )
90- .setBadge (1 )
85+ .setBadge (5 )
9186 .setSound ("happy" )
9287 .addExtra ("from" , "JPush" )
9388 .build ())
9489 .build ())
9590 .setMessage (Message .content (MSG_CONTENT ))
91+ .setOptions (Options .newBuilder ()
92+ .setApnsProduction (true )
93+ .build ())
9694 .build ();
9795 }
9896
0 commit comments