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()
45
45
{
46
46
$ fcmEndpoint = 'https://fcm.googleapis.com/fcm/send ' ;
47
47
48
- $ fields = [
49
- 'content-available ' => true ,
48
+ $ payloads = [
49
+ 'content_available ' => true ,
50
50
'priority ' => 'high ' ,
51
51
'data ' => $ this ->data ,
52
52
'notification ' => $ this ->notification
53
53
];
54
54
55
55
if ($ this ->topic ) {
56
- $ fields ['to ' ] = "/topics/ " . $ this ->topic ;
56
+ $ payloads ['to ' ] = "/topics/ { $ this ->topic }" ;
57
57
} else {
58
- $ fields ['registration_ids ' ] = $ this ->recipient ;
58
+ $ payloads ['registration_ids ' ] = $ this ->recipient ;
59
59
}
60
60
61
61
$ serverKey = config ('laravel-fcm.server_key ' );
@@ -71,7 +71,7 @@ public function send()
71
71
curl_setopt ($ ch , CURLOPT_HTTPHEADER , $ headers );
72
72
curl_setopt ($ ch , CURLOPT_RETURNTRANSFER , true );
73
73
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 ));
75
75
$ result = json_decode (curl_exec ($ ch ));
76
76
curl_close ($ ch );
77
77
You can’t perform that action at this time.
0 commit comments