LaravelFCM\Response\TopicResponse::shouldRetry PHP Method

shouldRetry() public method

return true if it's necessary resent it using exponential backoff
public shouldRetry ( ) : boolean
return boolean
    public function shouldRetry()
    {
        return $this->needRetry;
    }

Usage Example

    /**
     * @test
     */
    public function it_construct_a_topic_response_with_error_and_it_should_retry()
    {
        $topic = new \LaravelFCM\Message\Topics();
        $topic->topic('topicName');
        $response = new Response(200, [], '{ 
				"error": "TopicsMessageRateExceeded"
		}');
        $topicResponse = new TopicResponse($response, $topic);
        $this->assertFalse($topicResponse->isSuccess());
        $this->assertTrue($topicResponse->shouldRetry());
        $this->assertEquals("TopicsMessageRateExceeded", $topicResponse->error());
    }