Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/263.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 我没有在你的控制台中从firebase收到我的消息_Php_Android_Firebase - Fatal编程技术网

Php 我没有在你的控制台中从firebase收到我的消息

Php 我没有在你的控制台中从firebase收到我的消息,php,android,firebase,Php,Android,Firebase,早上好,我有一段代码显示发送Firebase的通知,如果我收到消息,代码是功能性的,并且是Android的一部分,但是我想在Firebird控制台中添加这条消息,看看有多少人看到了它 public function firebase(){ $apiKey = "awudaw:adwdawfag-xxxxxxxx"; $data = array('body'=>'Hola a todos tercero','title'=>'Tiene un nuev

早上好,我有一段代码显示发送Firebase的通知,如果我收到消息,代码是功能性的,并且是Android的一部分,但是我想在Firebird控制台中添加这条消息,看看有多少人看到了它

public function firebase(){

        $apiKey = "awudaw:adwdawfag-xxxxxxxx";
        $data = array('body'=>'Hola a todos tercero','title'=>'Tiene un nuevo mensaje global tercero');
        $fields = array("to"=>"/topics/tipi",'notification'=>$data);
        $headers = array('Authorization: key='.$apiKey,'Content-Type: application/json');

        $url = 'https://fcm.googleapis.com/fcm/send';

        $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_VERIFYPEER, false);
        curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($fields));
        $result = curl_exec($ch);
        curl_close($ch);
        return json_decode($result,true);
    }

显然,在论坛上做了很多研究之后,我想做的事情是不可能的。

显然,在论坛上做了很多研究之后,我想做的事情是不可能的。

不要关闭
CURLOPT\u SSL\u VERIFYPEER
。这可能存在安全风险。如果我激活它,JSON不会在本地主机中返回任何内容。你有问题吗?@mypetlion我的问题是如何使cURL发送的通知出现在firebaseDo not switch
CURLOPT_SSL_VERIFYPEER
的通知面板/控制台中。这可能存在安全风险。如果我激活它,JSON不会在本地主机中返回任何内容。您有问题吗?@mypetlion我的问题是如何使cURL发送的通知出现在firebase通知的面板/控制台中