CakePHP 4: Firebase Cloud Messaging Component in CakePHP for Push Notification
Easily deploy an SSD cloud server on @DigitalOcean in 55 seconds. Sign up using this link and receive $100 in cloud credits: https://m.do.co/t/335732d1df0b <?php namespace App\Controller\Component ; use Cake\Controller\ Component ; use Cake\Http\ Client ; class FirebaseComponent extends Component { public function headers () { $header = [ 'headers' => [ 'Accept' => 'application/json' , 'Content-Type' => 'application/json' , 'Authorization' => 'key=AAAAeh0kVhs4ums9A0SYyO2xbCgXvT_jfUUi-0jXs0GfMpZ5DZPqKylqht-TPXGPiqFVj81hBPLL_st9NkjspAarhbfufFHBQN_7' ] ]; return $header; } public function sendSingleNotification () //FCM { $fcToken = 'e_tHOI1XT3udZvMYS