Comments (6)
This error is displayed when I send consecutively
I'm not totally sure I understand what you mean. Do you mean that you send one push notification successfully, then try to send another and the second notification fails?
I tried to check for packet conflicts, but it didn't work
I'm really sorry, but I don't know what you mean by "packet conflicts." Do you mean TCP packet retransmissions?
Let's take a step back, though: does this happen every time you try to send a notification? Can you tell us more about your setup? Are you using a proxy, for example?
from pushy.
Sorry, I may not have made it clear. In a concurrent environment, the same client is used to send, for example, I sent more than a dozen messages at the same time, and then this problem occurred
from pushy.
I'm not totally sure I understand what you mean. Do you mean that you send one push notification successfully, then try to send another and the second notification fails?
I tried to check for packet conflicts, but it didn't work
I'm really sorry, but I don't know what you mean by "packet conflicts." Do you mean TCP packet retransmissions?
Let's take a step back, though: does this happen every time you try to send a notification? Can you tell us more about your setup? Are you using a proxy, for example?
yes, proxy is used
from pushy.
public static ApnsClient getApnsClient() throws NoSuchAlgorithmException{
if (apnsClient == null) {
byte[] bytes = decodeBase64EncodedString(privateKey);
final PKCS8EncodedKeySpec keySpec = new PKCS8EncodedKeySpec(bytes);
final KeyFactory keyFactory = KeyFactory.getInstance("EC");
ECPrivateKey signingKey;
try {
signingKey = (ECPrivateKey)keyFactory.generatePrivate(keySpec);
ApnsSigningKey signing = new ApnsSigningKey(keyId, teamId, signingKey);
signing.getEncoded();
apnsClient = new ApnsClientBuilder().setApnsServer(ApnsClientBuilder.PRODUCTION_APNS_HOST)
.setProxyHandlerFactory(new HttpProxyHandlerFactory(new InetSocketAddress(proxyAddress, port)))
.setSigningKey(signing).setConcurrentConnections(4)
.build();
} catch (Exception e) {
LogUtils.error("apns push create exception",null,e);
}
}
return apnsClient;
}
This is the client I created, is it created incorrectly ?I created it based on token, not in the way of .p12
from pushy.
PushNotificationFuture<SimpleApnsPushNotification, PushNotificationResponse<SimpleApnsPushNotification>>
future = apnsClient.sendNotification(simpleApnsPushNotification);
future.whenComplete((pushNotificationResponse,cause)->{
if (pushNotificationResponse != null) {
if (pushNotificationResponse.isAccepted()) {
LogUtils.info("Push notification accepted by APNs gateway.", request);
BuyerMessagePushSchedule.buyerAppleSuccessPushCounter.incrementAndGet();
} else {
String errorReason = pushNotificationResponse.getRejectionReason().toString();
if (errorReason.contains("BadDeviceToken") || errorReason.contains("Unregistered")) {
userDeviceService.setInvalidStatus(request.getfUserDeviceId());
}
BuyerMessagePushSchedule.buyerAppleFailurePushCounter.incrementAndGet();
LogUtils.error("push apns error", errorReason, null);
}
} else {
LogUtils.error("push apns exception cause",cause.getMessage());
}
});
This is how I use
from pushy.
I found the same problem in issues #829
from pushy.
Related Issues (20)
- javax.net.ssl.SSLHandshakeException: Server chose TLSv1, but that protocol version is not enabled or not supported by the client. HOT 5
- Stream closed before write could take place HOT 4
- push 0.15.1 io.netty.handler.codec.http2.StreamBufferingEncoder$Http2GoAwayException in a lot of requests HOT 2
- Support for "apns-unique-id" HOT 1
- return success when send notifacation after uninstalling app HOT 1
- I use Pushy to push the message,then I get "success=true",but the phone not responding HOT 2
- couple of Live Activity issues: stale-date is missing, and relevance-score can now have a value greater than 1.0 HOT 2
- Native SSL provider is available; will use native provider. HOT 4
- ApnsChannelPool java.io.IOException "Failed to create channel - Connection reset by peer" HOT 2
- Network is unreachable: `api.push.apple.com/2620:149:208:4308:0:0:0:a:443` HOT 13
- Missing "start" enumeration com.eatthepath.pushy.apns.util.LiveActivityEvent HOT 2
- add attributes-type and attributes to the payloadbuilder HOT 2
- Not able to use LiveActivityEvent class in the depenedcy HOT 2
- The issue of not being able to recognize PushType and DeliveryPriority from version 0.15.3 and onwards. HOT 1
- Connection exception occurred, but Pushy still used it HOT 2
- 如果连接时抛出 SslHandshakeTimeoutException 异常,那么 ApnsChannelPool pendingCreateChannelFutures 会一直被占有 HOT 7
- Wrong serialization of the object in JsonSerializer HOT 3
- Memory Leak HOT 1
- io.netty.handler.codec.http2.Http2Exception$StreamException: Stream closed before write could take place HOT 1
- Allow methods to not require passing a privateKeyPassword
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pushy.