mwkirk / javapns

Test import of svn javapns repo from Google Code
3 stars 0 forks source link

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

Closed mwkirk closed 11 years ago

mwkirk commented 11 years ago

Original author: hossein....@gmail.com (August 09, 2012 10:17:33)

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(&quot;notification.isSuccessful()&quot;);
        } 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: http://code.google.com/p/javapns/issues/detail?id=141

mwkirk commented 11 years ago

From sype...@gmail.com on August 11, 2012 18:01:40 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.

mwkirk commented 11 years ago

From sype...@gmail.com on September 08, 2012 02:23:15 Closing for lack of feedback from original poster.