src/main/java/org/codemonkey4fun/service/ApnsServiceImpl.java
/**
     * send notification parallel way
     *
     * @param notification
     * @param callBack
     */
send notification parallel way
@param notification
@param callBack
send notification parallel way @param notification @param callBack
@Override
    public void push(Notification notification, PushCallBack callBack) {
        SendResult result = new SendResult();
        Request request = composeRequest(notification);
        httpClient.newCall(request).enqueue(new Callback() {
            @Override
            public void onFailure(@NotNull Call call, @NotNull IOException e) {
                result.setCode(500);
                result.setMsg("Push message occurs exception");
                e.printStackTrace();
                if (callBack != null) {
                    callBack.callback(result);
                }
            }
            @Override
            public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException {
                int code = response.code();
                String data = response.body() != null ? response.body().string() : null;
                Headers headers = response.headers();
                composeSendResult(result, code, data, headers);
                if (callBack != null) {
                    callBack.callback(result);
                }
            }
        });
    }
@ Override public void push ( Notification notification , PushCallBack callBack ) { SendResult result = new SendResult ( ) ; Request request = composeRequest ( notification ) ; httpClient . newCall ( request ) . enqueue ( new Callback ( ) { @ Override public void onFailure ( @ NotNull Call call , @ NotNull IOException e ) { result . setCode ( 500 ) ; result . setMsg ( "Push message occurs exception" ) ; e . printStackTrace ( ) ; if ( callBack != null ) { callBack . callback ( result ) ; } } @ Override public void onResponse ( @ NotNull Call call , @ NotNull Response response ) throws IOException { int code = response . code ( ) ; String data = response . body ( ) != null ? response . body ( ) . string ( ) : null ; Headers headers = response . headers ( ) ; composeSendResult ( result , code , data , headers ) ; if ( callBack != null ) { callBack . callback ( result ) ; } } } ) ; }
send notification parallel way
 @param notification
 @param callBack
send notification parallel way @param notification @param callBack