webpro2 / javapns

Automatically exported from code.google.com/p/javapns
0 stars 0 forks source link

The Notification is sent successfully but never comes to the device. #141

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I have used the simple code to push a message to the iPhone. It does not prompt 
me any error and successfully sent the notification.

here is my code:

String[] devices = {""};
        List<PushedNotification> notifications= Push.alert("Hello", "Push.p12", "password", false, devices);

        for (PushedNotification notification : notifications) {
            if (notification.isSuccessful()) {
            out.println("notification.isSuccessful()");
            } else {
               // String invalidToken = notification.getDevice().getToken();
                Exception theProblem = notification.getException();
                                        theProblem.printStackTrace();

                /* If the problem was an error-response packet returned by Apple, get it */
                ResponsePacket theErrorResponse = notification.getResponse();
                if (theErrorResponse != null) {
                   out.println(theErrorResponse.getMessage());
                }
            }
        }

Original issue reported on code.google.com by hossein....@gmail.com on 9 Aug 2012 at 10:17

GoogleCodeExporter commented 9 years ago
I'm assuming that your "devices" list does contain a valid token and that you 
simply removed it to provide a copy of your code here?

Please provide all logs generated by JavaPNS.

Original comment by sype...@gmail.com on 11 Aug 2012 at 6:01

GoogleCodeExporter commented 9 years ago
Closing for lack of feedback from original poster.

Original comment by sype...@gmail.com on 8 Sep 2012 at 2:23