8
8
import cn .jpush .api .common .APIRequestException ;
9
9
import cn .jpush .api .push .PushResult ;
10
10
import cn .jpush .api .push .model .Message ;
11
+ import cn .jpush .api .push .model .Options ;
11
12
import cn .jpush .api .push .model .Platform ;
12
13
import cn .jpush .api .push .model .PushPayload ;
13
14
import cn .jpush .api .push .model .audience .Audience ;
14
15
import cn .jpush .api .push .model .audience .AudienceTarget ;
15
- import cn .jpush .api .push .model .notification .AndroidNotification ;
16
16
import cn .jpush .api .push .model .notification .IosNotification ;
17
17
import cn .jpush .api .push .model .notification .Notification ;
18
18
@@ -71,12 +71,7 @@ public static PushPayload buildPushObject_android_tag_alertWithTitle() {
71
71
return PushPayload .newBuilder ()
72
72
.setPlatform (Platform .android ())
73
73
.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 ))
80
75
.build ();
81
76
}
82
77
@@ -87,12 +82,15 @@ public static PushPayload buildPushObject_ios_tagAnd_alertWithExtrasAndMessage()
87
82
.setNotification (Notification .newBuilder ()
88
83
.addPlatformNotification (IosNotification .newBuilder ()
89
84
.setAlert (ALERT )
90
- .setBadge (1 )
85
+ .setBadge (5 )
91
86
.setSound ("happy" )
92
87
.addExtra ("from" , "JPush" )
93
88
.build ())
94
89
.build ())
95
90
.setMessage (Message .content (MSG_CONTENT ))
91
+ .setOptions (Options .newBuilder ()
92
+ .setApnsProduction (true )
93
+ .build ())
96
94
.build ();
97
95
}
98
96
0 commit comments