APNS token based push notifications stopped working

57 views
Skip to first unread message

Fathima Haiyum

unread,
May 1, 2020, 12:08:49 PM5/1/20
to pushy

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?

Jon Chambers

unread,
May 1, 2020, 1:21:48 PM5/1/20
to pushy
Hello!

This sounds suspiciously like https://github.com/jchambers/pushy/issues/773. We're trying to gather information to figure out if this is an upstream issue (i.e. something changed on Apple's end). At your next opportunity, could you please read through #773 and see if it matches your problem? Also, which version of Pushy are you using?

Thanks very much!

-Jon
Reply all
Reply to author
Forward
0 new messages