update 1.0.8.0

Commits for version update
This commit is contained in:
Manish Verma
2016-10-17 12:02:27 +05:30
parent dec927987b
commit 76e85db070
9674 changed files with 495757 additions and 58922 deletions

View File

@@ -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";

View 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();
}

View File

@@ -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";

View 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();
}

View File

@@ -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";

View 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();
}