RMSPushNotificationsBundle
RMSPushNotificationsBundle copied to clipboard
How control status sending message?
This bundle have a problems:
- Can not send messages from queue. Can create a collection (ArrayObject)?
- Not found control status message. Can return status messages after call send()?
+1
+1
I do agree with your second point. To go around this problem really quickly i did something like that :
public function send(MessageInterface $message)
{
...
$errorResponses = array();
// Determine success
foreach ($this->responses as $response) {
$message = json_decode($response->getContent());
if ($message === null || $message->success == 0 || $message->failure > 0) {
if ($message == null) {
$this->logger->err($response->getContent());
} else {
$this->logger->err($message->failure);
}
$errorResponses[] = $response;
}
}
return $errorResponses;
}
And in my service i browse each erroResponse content to determine why it failed.
It has to be improved to return something true in case of success or manage errors in the Bundle.