I\'m trying to place a best guess estimate as to whether C2DM messages can be received.
I\'ve created an application that relies on pushing information to a phone while
I've worked a little with C2Dm, I've created my own push 3rd party server . I've implemented a little logic based oh C2DM http response code to know if a push message was sent or not . Here is some of the code I used :
int responseCode = conn.getResponseCode();
if (responseCode == HttpServletResponse.SC_UNAUTHORIZED || responseCode == HttpServletResponse.SC_FORBIDDEN) {
LOGGER.warn("Unauthorized - need token");
return false;
}
here I'm almost sure that the push message was sent from the c2dm servers because I've got an id ont the response:
if (responseParts[0].equals("id")) {
LOGGER.info("Successfully sent data message to device: " + responseLine);
return true;
}
I've used other methods to get other result codes from Google if you want I can post them.I hope that I've helped you a bit .