update 1.0.8.0
Commits for version update
This commit is contained in:
@@ -9,7 +9,7 @@ use GuzzleHttp\Psr7\Response as GuzzleResponse;
|
||||
*
|
||||
* @package LaravelFCM\Response
|
||||
*/
|
||||
class DownstreamResponse extends BaseResponse {
|
||||
class DownstreamResponse extends BaseResponse implements DownstreamResponseContract{
|
||||
|
||||
const MULTICAST_ID = 'multicast_id';
|
||||
const CANONICAL_IDS = "canonical_ids";
|
||||
|
||||
85
vendor/brozot/laravel-fcm/src/Response/DownstreamResponseContract.php
vendored
Normal file
85
vendor/brozot/laravel-fcm/src/Response/DownstreamResponseContract.php
vendored
Normal file
@@ -0,0 +1,85 @@
|
||||
<?php namespace LaravelFCM\Response;
|
||||
|
||||
/**
|
||||
* Interface DownstreamResponseContract
|
||||
*
|
||||
* @package LaravelFCM\Response
|
||||
*/
|
||||
interface DownstreamResponseContract {
|
||||
|
||||
/**
|
||||
* Merge two response
|
||||
*
|
||||
* @param DownstreamResponse $response
|
||||
*/
|
||||
public function merge(DownstreamResponse $response);
|
||||
|
||||
/**
|
||||
* Get the number of device reached with success
|
||||
* @return int
|
||||
*/
|
||||
public function numberSuccess();
|
||||
|
||||
/**
|
||||
* Get the number of device which thrown an error
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function numberFailure();
|
||||
|
||||
/**
|
||||
* Get the number of device that you need to modify their token
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function numberModification();
|
||||
|
||||
/**
|
||||
* get token to delete
|
||||
*
|
||||
* remove all tokens returned by this method in your database
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function tokensToDelete();
|
||||
|
||||
/**
|
||||
* get token to modify
|
||||
*
|
||||
* key: oldToken
|
||||
* value: new token
|
||||
*
|
||||
* find the old token in your database and replace it with the new one
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function tokensToModify();
|
||||
|
||||
/**
|
||||
* Get tokens that you should resend using exponential backoof
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function tokensToRetry();
|
||||
|
||||
/**
|
||||
* Get tokens that thrown an error
|
||||
*
|
||||
* key : token
|
||||
* value : error
|
||||
*
|
||||
* In production, remove these tokens from you database
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function tokensWithError();
|
||||
|
||||
/**
|
||||
* check if missing tokens was given to the request
|
||||
* If true, remove all the empty token in your database
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function hasMissingToken();
|
||||
|
||||
}
|
||||
@@ -9,7 +9,7 @@ use GuzzleHttp\Psr7\Response as GuzzleResponse;
|
||||
*
|
||||
* @package LaravelFCM\Response
|
||||
*/
|
||||
class GroupResponse extends BaseResponse {
|
||||
class GroupResponse extends BaseResponse implements GroupResponseContract{
|
||||
|
||||
const FAILED_REGISTRATION_IDS = "failed_registration_ids";
|
||||
|
||||
|
||||
30
vendor/brozot/laravel-fcm/src/Response/GroupResponseContract.php
vendored
Normal file
30
vendor/brozot/laravel-fcm/src/Response/GroupResponseContract.php
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php namespace LaravelFCM\Response;
|
||||
|
||||
/**
|
||||
* Interface GroupResponseContract
|
||||
*
|
||||
* @package LaravelFCM\Response
|
||||
*/
|
||||
interface GroupResponseContract {
|
||||
|
||||
/**
|
||||
* Get the number of device reached with success
|
||||
* @return int
|
||||
*/
|
||||
public function numberSuccess();
|
||||
|
||||
/**
|
||||
* Get the number of device which thrown an error
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function numberFailure();
|
||||
|
||||
/**
|
||||
* Get all token in group that fcm cannot reach
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function tokensFailed();
|
||||
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php namespace LaravelFCM\Response;
|
||||
|
||||
use LaravelFCM\Message\Topics;
|
||||
use Monolog\Logger;
|
||||
use LaravelFCM\Message\Topics;
|
||||
use Monolog\Handler\StreamHandler;
|
||||
use GuzzleHttp\Psr7\Response as GuzzleResponse;
|
||||
|
||||
@@ -10,7 +10,7 @@ use GuzzleHttp\Psr7\Response as GuzzleResponse;
|
||||
*
|
||||
* @package LaravelFCM\Response
|
||||
*/
|
||||
class TopicResponse extends BaseResponse {
|
||||
class TopicResponse extends BaseResponse implements TopicResponseContract{
|
||||
|
||||
const LIMIT_RATE_TOPICS_EXCEEDED = "TopicsMessageRateExceeded";
|
||||
|
||||
|
||||
31
vendor/brozot/laravel-fcm/src/Response/TopicResponseContract.php
vendored
Normal file
31
vendor/brozot/laravel-fcm/src/Response/TopicResponseContract.php
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php namespace LaravelFCM\Response;
|
||||
|
||||
/**
|
||||
* Interface TopicResponseContract
|
||||
*
|
||||
* @package LaravelFCM\Response
|
||||
*/
|
||||
interface TopicResponseContract {
|
||||
|
||||
/**
|
||||
* true if topic sent with success
|
||||
* @return bool
|
||||
*/
|
||||
public function isSuccess();
|
||||
|
||||
/**
|
||||
* return error message
|
||||
* you should test if it's necessary to resent it
|
||||
*
|
||||
* @return string error
|
||||
*/
|
||||
public function error();
|
||||
|
||||
/**
|
||||
* return true if it's necessary resent it using exponential backoff
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function shouldRetry();
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user