MulticastResult multicastResult = sender.send(message, Lists.newArrayList(registrationIds), 10);
// analyze the results
for (int i = 0; i < registrationIds.size(); i++) {
Result result = multicastResult.getResults().get(i);
Device device = devices.get(i);
if (result.getMessageId() != null) {
LOGGER.info("Sent GCM message to " + device);
String canonicalRegId = result.getCanonicalRegistrationId();
if (canonicalRegId != null) {
// same device has more than on registration id: update it
device.updateRegistrationId(canonicalRegId);
pushResponse.addDeviceToUpdate(device);
LOGGER.info("Updated registration id of device " + device);
}
} else {
String error = result.getErrorCodeName();