Closed cajax closed 9 years ago
thanks - PR welcome if you have time :-)
I am about to implement it. I'll try to make it nice and tidy before PR.
OK, looks like it isn't necessary since there is getResponses()
method. This code should work:
$sent = $notificationsService->send($pushMessage);
$responses = $notificationsService->getResponses('rms_push_notifications.os.android.gcm');
foreach ($responses as $response) {
$message = json_decode($response->getContent());
if (!empty($message->registration_id)) {
//update record in database
}
}
that's fine - thanks for the update :-)
GCM server may respond with canonical ID to replace an outdated/expired registration ID sent in request. I think send() method should handle it and return.
http://developer.android.com/google/gcm/adv.html