My code looks like this:
@Override public void send(PushNotification note) {
log.info("sending message");
ApnsPayloadBuilder builder = new ApnsPayloadBuilder();
builder.setAlertTitle("test");
builder.setAlertBody("test");
String payload = builder.buildWithDefaultMaximumLength();
Date date = new DateTime().plusDays(1).toDate();
final SimpleApnsPushNotification pushNotification = new SimpleApnsPushNotification("devicetoken","com.example.ios", payload, date);
try {
final PushNotificationResponse<SimpleApnsPushNotification> pushNotificationResponse = sendNotificationFuture.get();
if (pushNotificationResponse.isAccepted()) {
System.out.println("Push notification accepted by APNs gateway.");
}
else {
System.out.println("Notification rejected by the APNs gateway: " + pushNotificationResponse.getRejectionReason());
}
}
catch (final ExecutionException e) {
System.err.println("Failed to send push notification.");
e.printStackTrace();
}
We are using token based authentication and the notifications were working perfectly until a few days ago. In the logs, I can't see a success, rejection or failure message now but I see "sending message". What could this possibly mean?