notnoop / java-apns

Java Apple Push Notification Service Provider
notnoop.github.com/java-apns
BSD 3-Clause "New" or "Revised" License
1.79k stars 656 forks source link

Delegate not working VoipPush #340

Open MrPallaBall opened 7 years ago

MrPallaBall commented 7 years ago

Hi to all, I had develop a service to push voip notifications and in it I had implemented a "Delegate Method" (it return a ApnsDelegate Object).

APNS.newService()
.withCert(voipcert , password)
.withDelegate(getDelegate())
.withAppleDestination(true)
.build()

private ApnsDelegate getDelegate() {
        return new ApnsDelegate() {
            public void notificationsResent(int resendCount) {
                log.info("resendCount=" + resendCount);
            }

            public void messageSent(ApnsNotification message, boolean resent) {
                log.info("Message sent. Payload={}" + message);
            }

            public void messageSendFailed(ApnsNotification message, Throwable e) {
                log.error("Message send failed. Message="+ message.toString() + " token=" + message.getDeviceToken().toString()
                                + " payload=" + message.getPayload().toString()
                                + " Throwable.getLocalizedMessage=" + e.getLocalizedMessage()
                                + " Throwable.getMessage=" +  e.getMessage());

            }

            public void connectionClosed(DeliveryError e, int messageIdentifier) {
                log.error("Connection closed. Message = " + e.toString() + " messageIdentifier = " + messageIdentifier);
            }

            public void cacheLengthExceeded(int newCacheLength) {
                log.error("cacheLengthExceeded " + newCacheLength);
            }
        };
    }

I uninstalled the application and I send a notification to application's device-token

Java-APNS not use Delagate Method when I send a voip notification to a device-token of uninstalled application.

What about it?