Verified Commit 1cde1118 authored by Richard Weinhold's avatar Richard Weinhold 🔨

changes the dummy callback to be called for each device

parent 283e2990
......@@ -15,6 +15,10 @@ class Dummy extends Handler
*/
private $callback;
/**
* Dummy constructor.
* @param callable|null $sendCallback function(array $payload, string $deviceToken)
*/
public function __construct(?callable $sendCallback = null)
{
$this->callback = $sendCallback;
......@@ -59,7 +63,9 @@ class Dummy extends Handler
'priority' => $priority === Config::PRIORITY_HIGH ? 'high' : 'normal',
]);
call_user_func($this->callback, $payload);
foreach ($this->devices as $deviceToken) {
call_user_func($this->callback, $payload, $deviceToken);
}
return $this->resetAndBuildFeedback();
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment