How to send push notification for Huawei devices using Java through proxy server
HttpPost httpPost = new HttpPost(this.HcmPushUrl);
StringEntity entity = new StringEntity(JSON.toJSONString(map), "UTF-8");
httpPost.setHeader("Authorization", "Bearer " + accessToken);
httpPost.setHeader("Content-Type", "application/json;charset=utf-8");
httpPost.setEntity(entity);
CloseableHttpResponse response = httpClient.execute(httpPost);
String rpsContent = EntityUtils.toString(response.getEntity());
Which is something similar to ProxyManager.setProxy(proxyAddress, proxyPort) of APNS call.
Please kindly refer to the following code:
HMS Pushkit Java Severdemo On Github