for (final SimpleApnsPushNotification pushNotification : pushNotificationList) {
final PushNotificationFuture<SimpleApnsPushNotification,PushNotificationResponse<SimpleApnsPushNotification>> sendNotificationFuture = client.sendNotification(pushNotification);
sendNotificationFuture.whenComplete((response, cause) -> {
if(response != null) {
if (response.isAccepted()) {
logger.info("Push notification accepted by APNs gateway for apnsId ="+response.getApnsId() );
} else {
logger.info("Notification rejected by the APNs gateway: " +
response.getRejectionReason());
response.getTokenInvalidationTimestamp().ifPresent(timestamp -> {
logger.info("\t…and the token is invalid as of " + timestamp);
});
}
} else {
logger.error("error ");
}
});
}
final CompletableFuture<Void> closeFuture = client.close();
Hi All,This is very Important for me. Please I need your help on this. I am new to pushy .Currently my requirement is to send notification to 15,000 devices at a time. I have few challenges to make my implementation successful.1. As Im using completable future for notification response acknowledgement(15k notifications) , Is there a way I could know when the last acknowledgement is received.2. Do I need to wait for acknowledgement to be received before I close the client. Or should I just care about just sending 15 K notifications and close the client?3. Do I need to add listeners if i am using completable future to track response?4. I want to save my responses into the database. Is it possible?5. Can you suggest any thing for below implementatin?Help is greatly appreciated. I really need to nail this down. Please need some suggestions.