Skip to content

Commit f0f9fe1

Browse files
authored
Merge pull request #58 from Hayat-Umar/master
Package Restriction
2 parents a42d19a + 6762fdd commit f0f9fe1

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/Fcm.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ class Fcm
1616
protected $notification;
1717
protected $timeToLive;
1818
protected $priority;
19+
protected $package;
1920

2021
protected $serverKey;
2122

@@ -72,6 +73,13 @@ public function timeToLive($timeToLive)
7273

7374
return $this;
7475
}
76+
77+
public function setPackage($package)
78+
{
79+
$this->package = $package;
80+
81+
return $this;
82+
}
7583

7684
public function send()
7785
{
@@ -81,6 +89,11 @@ public function send()
8189
'data' => $this->data,
8290
'notification' => $this->notification
8391
];
92+
93+
if(!empty($this->package))
94+
{
95+
$payloads['restricted_package_name'] = $this->package;
96+
}
8497

8598
if ($this->topic) {
8699
$payloads['to'] = "/topics/{$this->topic}";

0 commit comments

Comments
 (0)