mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-05-09 20:12:14 +09:00
Preserve success/deleted/updates tokens from both drivers
This commit is contained in:
parent
dcbd5ff9b6
commit
5a90f97f89
1 changed files with 6 additions and 3 deletions
|
|
@ -295,6 +295,9 @@ class Push
|
||||||
$fcm_driver = $this->getDriver('fcm');
|
$fcm_driver = $this->getDriver('fcm');
|
||||||
$output = $fcm_driver->send($this, $tokens->android);
|
$output = $fcm_driver->send($this, $tokens->android);
|
||||||
$this->sent = count($output->success) ? true : false;
|
$this->sent = count($output->success) ? true : false;
|
||||||
|
$this->success_tokens = $output ? $output->success : [];
|
||||||
|
$this->deleted_tokens = $output ? $output->invalid : [];
|
||||||
|
$this->updated_tokens = $output ? $output->needUpdate : [];
|
||||||
$this->_deleteInvalidTokens($output->invalid);
|
$this->_deleteInvalidTokens($output->invalid);
|
||||||
$this->_updateDeviceTokens($output->needUpdate);
|
$this->_updateDeviceTokens($output->needUpdate);
|
||||||
}
|
}
|
||||||
|
|
@ -305,13 +308,13 @@ class Push
|
||||||
$apns_driver =$this->getDriver('apns');
|
$apns_driver =$this->getDriver('apns');
|
||||||
$output = $apns_driver->send($this, $tokens->ios);
|
$output = $apns_driver->send($this, $tokens->ios);
|
||||||
$this->sent = count($output->success) ? true : false;
|
$this->sent = count($output->success) ? true : false;
|
||||||
|
$this->success_tokens += $output ? $output->success : [];
|
||||||
|
$this->deleted_tokens += $output ? $output->invalid : [];
|
||||||
|
$this->updated_tokens += $output ? $output->needUpdate : [];
|
||||||
$this->_deleteInvalidTokens($output->invalid);
|
$this->_deleteInvalidTokens($output->invalid);
|
||||||
$this->_updateDeviceTokens($output->needUpdate);
|
$this->_updateDeviceTokens($output->needUpdate);
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->success_tokens = $output ? $output->success : [];
|
|
||||||
$this->deleted_tokens = $output ? $output->invalid : [];
|
|
||||||
$this->updated_tokens = $output ? $output->needUpdate : [];
|
|
||||||
}
|
}
|
||||||
catch(\Exception $e)
|
catch(\Exception $e)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue