aboutsummaryrefslogtreecommitdiff
path: root/juick-notifications/src/main/java/com/juick
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2018-09-20 15:16:06 +0300
committerGravatar Vitaly Takmazov2018-09-20 15:16:06 +0300
commitf58bb4d659f5d7dd43255a61ac8cb5023859d59d (patch)
treeb4e8c60c6e6a63d1636e7b691877514321535ab0 /juick-notifications/src/main/java/com/juick
parenta9988515d26d3451bfad8bd5549f15c7648d5562 (diff)
APNS: check token invalidation timestamp
Diffstat (limited to 'juick-notifications/src/main/java/com/juick')
-rw-r--r--juick-notifications/src/main/java/com/juick/components/Notifications.java4
1 files changed, 4 insertions, 0 deletions
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);
}