From f58bb4d659f5d7dd43255a61ac8cb5023859d59d Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Thu, 20 Sep 2018 15:16:06 +0300 Subject: APNS: check token invalidation timestamp --- .../src/main/java/com/juick/components/Notifications.java | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'juick-notifications/src/main/java/com/juick') diff --git a/juick-notifications/src/main/java/com/juick/components/Notifications.java b/juick-notifications/src/main/java/com/juick/components/Notifications.java index 7b3f823e..53bf8684 100644 --- a/juick-notifications/src/main/java/com/juick/components/Notifications.java +++ b/juick-notifications/src/main/java/com/juick/components/Notifications.java @@ -229,6 +229,10 @@ public class Notifications extends TextWebSocketHandler implements NotificationC invalidAPNSTokens.add(token); } } + if (pushNotificationResponse.getTokenInvalidationTimestamp().before(new Date())) { + logger.info("Token invalidated: {}", token); + invalidAPNSTokens.add(token); + } } catch (final ExecutionException | InterruptedException ex) { logger.info("APNS exception", ex); } -- cgit v1.2.3