File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -45,17 +45,17 @@ public function send()
4545 {
4646 $ fcmEndpoint = 'https://fcm.googleapis.com/fcm/send ' ;
4747
48- $ fields = [
49- 'content-available ' => true ,
48+ $ payloads = [
49+ 'content_available ' => true ,
5050 'priority ' => 'high ' ,
5151 'data ' => $ this ->data ,
5252 'notification ' => $ this ->notification
5353 ];
5454
5555 if ($ this ->topic ) {
56- $ fields ['to ' ] = "/topics/ " . $ this ->topic ;
56+ $ payloads ['to ' ] = "/topics/ { $ this ->topic }" ;
5757 } else {
58- $ fields ['registration_ids ' ] = $ this ->recipient ;
58+ $ payloads ['registration_ids ' ] = $ this ->recipient ;
5959 }
6060
6161 $ serverKey = config ('laravel-fcm.server_key ' );
@@ -71,7 +71,7 @@ public function send()
7171 curl_setopt ($ ch , CURLOPT_HTTPHEADER , $ headers );
7272 curl_setopt ($ ch , CURLOPT_RETURNTRANSFER , true );
7373 curl_setopt ($ ch , CURLOPT_SSL_VERIFYPEER , CURL_IPRESOLVE_V4 );
74- curl_setopt ($ ch , CURLOPT_POSTFIELDS , json_encode ($ fields ));
74+ curl_setopt ($ ch , CURLOPT_POSTFIELDS , json_encode ($ payloads ));
7575 $ result = json_decode (curl_exec ($ ch ));
7676 curl_close ($ ch );
7777
You can’t perform that action at this time.
0 commit comments