CakePHP API服务器响应时间和FCM推送通知

CakePHP API服务器响应时间和FCM推送通知,cakephp,push-notification,Cakephp,Push Notification,我有一个CakePHP API服务器,它使用以下代码触发向设备发送推送通知: $url = 'https://fcm.googleapis.com/fcm/send'; $headers = array( 'Authorization:key = <<Authorization Key>', 'Content-Type: application/json' )

我有一个CakePHP API服务器,它使用以下代码触发向设备发送推送通知:

        $url = 'https://fcm.googleapis.com/fcm/send';
        $headers = array(
                'Authorization:key = <<Authorization Key>',
                'Content-Type: application/json'
            );
        $ch = curl_init();
        curl_setopt($ch, CURLOPT_URL, $url);
        curl_setopt($ch, CURLOPT_POST, true);
        curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
        curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
        curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
        curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
        $result = curl_exec($ch);
        if ($result === false ){
            die('Curl failed: '. curl_error($ch));      
        }
        curl_close($ch);
$url='1!'https://fcm.googleapis.com/fcm/send';
$headers=数组(

'Authorization:key=实现一个队列。将发送API调用的任务发送给工作进程,您无需等待它完成


检查此插件,它将允许您创建任务并对其进行排队。或者此CakePHP特定插件实现一个队列。将发送API调用的任务发送给工作者,您无需等待任务完成


检查此插件,它将允许您创建任务并对它们进行排队。或者此CakePHP特定插件

感谢@burzum。我选择了CakePHP特定插件和解决方案,效果非常好!感谢@burzum。我选择了CakePHP特定插件和解决方案,效果非常好!