File "firebase.php"

Full Path: /home/analogde/www/filechange/WEBSITE/douche/firebase.php
File size: 1.18 KB
MIME-type: text/x-php
Charset: utf-8

<?php
		$path_to_firebase_cm = 'https://fcm.googleapis.com/fcm/send';
    
	
		$token = "AAAAUtrk-fg:APA91bGiVUkgyaqSAeTOKIjPixxPZJAL-GOVGPYmmuaU99plSxiNqwlEtn5j0gEtE1XAggOupB2RndmvBQZLNHxdjqqavVTjfPChInkxpIl7cqnxNNkFHL-yp1j0DtEGmWLvE4QWT7_HLFYvYFPrh3iT6W6_mNZhwg";
 	
        $fields = array(
            'to' => $token,
            'notification' => array('title' => 'Working Good', 'body' => 'That is all we want'),
            'data' => array('message' => $message)
        );
 
  $api_KEY = "AIzaSyAquEV6k0bgU4l5pkxqVtriB8GwCMD0IxE"; 
  
 
        $headers = array(
            'Authorization:key=' . $api_KEY,
            'Content-Type:application/json'
        );		
		
		
        $ch = curl_init();
 
        curl_setopt($ch, CURLOPT_URL, $path_to_firebase_cm); 
        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_IPRESOLVE, CURL_IPRESOLVE_V4 ); 
        curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($fields));
    
        $result = curl_exec($ch);
       
        curl_close($ch);
		
		echo "done";

?>