Java Aurora push
Note: need to go to the official website to download jpush-client-3.2.3.jar
/*** Aurora push tool class ** @ author why **/@ SuppressWarnings ("all") public class JPushAllUtil {private final static String appKey = ""; private final static String masterSecret = "";/*** Test Method */public static void main (String [] args) {// send a notification jSend_notification ("0a139889879 ", "You have a new logistic message _ 123 ");} /*** send notification ** @ param registrationId device ID * @ param alert push content */public static void jSend_notification (String registrationId, String alert) {JPushClient jpushClient = new JPushClient (masterSecret, appKey, 3); PushPayload payload = send_N (registrationId, alert); try {PushResult result = jpushClient. sendPush (payload); System. out. println (result);} catch (APIConnectionException e) {System. out. println (e);} catch (APIRequestException e) {System. out. println (e); System. out. println ("Error response from JPush server. shoshould re View and fix it. "+ e); System. out. println ("HTTP Status:" + e. getStatus (); System. out. println ("Error Code:" + e. getErrorCode (); System. out. println ("Error Message:" + e. getErrorMessage (); System. out. println ("Msg ID:" + e. getMsgId () ;}} public static PushPayload send_N (String registrationId, String alert) {return PushPayload. newBuilder (). setPlatform (Platform. android_ios () // push platform settings are required. setAudi Ence (Audience. registrationId (registrationId )). setNotification (Notification. alert (alert)/*** if the target platform is iOS, you need to use the apns_production field in options * to create a push environment. * True indicates the push production environment, and False indicates the push development environment. If * is not specified, the push production environment */. setOptions (Options. newBuilder (). setApnsProduction (false ). build ()). build ();}}