@@ -66,6 +66,17 @@ function notificationTitle($title){
66
66
return $ this ;
67
67
}
68
68
69
+ /**
70
+ * Set the notification sound (Android/IOS);
71
+ * set to "default" for default sound, null to remove
72
+ * @param string $sound
73
+ * @return $this
74
+ */
75
+ function notificationSound ($ sound ){
76
+ $ this ->message ->android ->notification ->sound = $ sound ;
77
+ return $ this ;
78
+ }
79
+
69
80
/**
70
81
* Set the notification body
71
82
* @param string $body
@@ -79,18 +90,48 @@ function notificationBody($body){
79
90
/**
80
91
* Set the message priority
81
92
* @param 'high'|"normal" $priority
82
- * @return FcmMessageBuilder
93
+ * @return $this
83
94
*/
84
95
function priority ($ priority ){
85
96
if ($ priority !=='high ' && $ priority !=='normal ' )
86
97
throw new \InvalidArgumentException ('Invalid priority value! ' );
87
98
$ this ->message ->android ->setPriority ($ priority );
88
99
return $ this ;
89
100
}
101
+ /**
102
+ * Set the message tag (Android/IOS)
103
+ * @param string $tag
104
+ * @return $this
105
+ */
106
+ function notificationTag ($ tag ){
107
+ $ this ->message ->android ->notification ->tag = $ tag ;
108
+ return $ this ;
109
+ }
110
+
111
+
112
+ /**
113
+ * Set Android message options with a callback
114
+ * @param Closure(\Plokko\Firebase\FCM\Message\AndroidNotification) $closure
115
+ * @return $this
116
+ */
117
+ function setAndroidNotification ($ closure ){
118
+ $ closure ($ this ->android ->notification );
119
+ return $ this ;
120
+ }
121
+
122
+ /**
123
+ * Set Android message options with a callback
124
+ * @param Closure(\Plokko\Firebase\FCM\Message\AndroidConfig) $closure
125
+ * @return $this
126
+ */
127
+ function setAndroidConfig ($ closure ){
128
+ $ closure ($ this ->android );
129
+ return $ this ;
130
+ }
90
131
91
132
/**
92
133
* Set high priority
93
- * @return FcmMessageBuilder
134
+ * @return $this
94
135
*/
95
136
function highPriority (){
96
137
$ this ->priority ('high ' );
@@ -99,7 +140,7 @@ function highPriority(){
99
140
100
141
/**
101
142
* Set normal priority
102
- * @return FcmMessageBuilder
143
+ * @return $this
103
144
*/
104
145
function normalPriority (){
105
146
$ this ->priority ('normal ' );
@@ -109,7 +150,7 @@ function normalPriority(){
109
150
/**
110
151
* Set the time to live of the message
111
152
* @param string $ttl TTL as a string (ex. '14.5s')
112
- * @return FcmMessageBuilder
153
+ * @return $this
113
154
*/
114
155
function ttl ($ ttl ){
115
156
$ this ->message ->android ->ttl ($ ttl );
0 commit comments