Don't retry APN on bad device token

This commit is contained in:
Moxie Marlinspike 2019-03-22 17:40:06 -07:00
parent a5f844bc7d
commit ed766484d2
1 changed files with 3 additions and 1 deletions

View File

@ -131,7 +131,9 @@ public class RetryingApnsClient {
if (response.isAccepted()) {
future.set(new ApnResult(ApnResult.Status.SUCCESS, null));
} else if ("Unregistered".equals(response.getRejectionReason())) {
} else if ("Unregistered".equals(response.getRejectionReason()) ||
"BadDeviceToken".equals(response.getRejectionReason()))
{
future.set(new ApnResult(ApnResult.Status.NO_SUCH_USER, response.getRejectionReason()));
} else {
logger.warn("Got APN failure: " + response.getRejectionReason());