Skip to content

Commit 40a1543

Browse files
authored
Merge pull request #3 from az-iar/master
add method to set badge number
2 parents 6c4cfdc + 47fc09f commit 40a1543

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.idea
2+
/vendor
3+
composer.lock
4+
composer.phar

src/FirebaseMessage.php

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,40 @@ public function title($value)
6060
return $this;
6161
}
6262

63+
/**
64+
* Set notification sound
65+
*
66+
* @param string $value
67+
*
68+
* @return $this
69+
*/
6370
public function sound($value = 'default')
6471
{
6572
$this->notification->setSound($value);
6673

6774
return $this;
6875
}
6976

77+
/**
78+
* Set badge number. IOS only
79+
*
80+
* @param int $integer
81+
*
82+
* @return $this
83+
*/
84+
public function badge($integer)
85+
{
86+
$this->notification->setBadge($integer);
87+
88+
return $this;
89+
}
90+
91+
/**
92+
* Set additional data
93+
*
94+
* @param array $values
95+
* @return $this
96+
*/
7097
public function data(array $values = [])
7198
{
7299
$this->data = $values;

0 commit comments

Comments
 (0)