When I try to execute an apple push notification on the server I get the following error:
com.notnoop.exceptions.ApnsDeliveryErrorException: Failed to deliver notification with error code 8
My server is a Java application. It is strange that the same server WAR file works OK locally (notifications are sent), but it does not work (with error above) when I deploy it to remote server (RedHat openshift.com).
Here is what I do:
APNS.newService().withCert(certificateInputStream,"password").withProductionDestination().withDelegate(this).build();
Can you help? What could be the reason that the same setup works on a local but fail on a remote server?
It appeared to be another error. The server contained old deployment (war) file, which was still pointing to the sandbox APNS environment. After I redeployed manually, the problem is gone.