We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 034cff0 commit 7de8dd7Copy full SHA for 7de8dd7
src/Fcm.php
@@ -41,11 +41,18 @@ public function notification(array $notification = [])
41
42
return $this;
43
}
44
-
+
45
public function timeToLive(int $timeToLive)
46
{
47
+ if ($timeToLive < 0) {
48
+ $timeToLive = 0; // (0 seconds)
49
+ }
50
+ if ($timeToLive > 2419200) {
51
+ $timeToLive = 2419200; // (28 days)
52
53
54
$this->timeToLive = $timeToLive;
55
56
57
58
@@ -65,7 +72,7 @@ public function send()
65
72
} else {
66
73
$payloads['registration_ids'] = $this->recipients;
67
74
68
75
69
76
if ($this->timeToLive !== null && $this->timeToLive >= 0) {
70
77
$payloads['time_to_live'] = (int) $this->timeToLive;
71
78
0 commit comments