<?php
// Server key from Firebase Console
// $registrationIds='c9PZulBCnE_psF7cQIHsSR:APA91bE7AYy-6NqpaXhHQtPvTeHBUvCtnTg40AqbkJFY23yjG6A7iV3ZDTiUOoaKruZxHKxEbsdKdmmiWC0qBsSumjnEnyMU8ruyaYJdOLiXRbdquUnfTBnYY4CoUEDGwQ-LKiVxIjrf';
//  $registrationIds='dGRRop5bNU78jdSEzIRSRd:APA91bFsgRyrsE8DHTL79SRRYCX5T0xdWumoWRVDqCz5Kj80bNzmudeqUlPjgV9g0bX7xKKLz3pR4CTIiDdWkufFrjcQRUZ4Pu8BR6ExWN2qqSsai6j7APzpsXDfVbvFFRK1cDNnu91I';
$registrationIds='ejLyZjlZipk:APA91bGalXqGZBi-_94xIDbuTy_Iezf3MM4xmPj-5X6lb-ACp_deq4Z08Uv79ZLSD18pIU6-bVXewT7-nwPCa5SZDk4oW0SOMdnPn5pMhK-8joYNro2M5fhAjQr25B_-KNN6zpqet0xp';
            define( 'API_ACCESS_KEY', 'AIzaSyDzlkqCtDFrU6O3dSS_9cKCssXwRuUx7r8' );
            
            $data = array("to" => $registrationIds,
                          "data" => array( "title" => "New Message Receive ", "body" => 'test 4',"icon" => "https://dynamicds.co.uk/eevop/eevop/images/logo.jpg", "click_action" => "https://dynamicds.co.uk/eevop/eevop/serviceprovider/html/employee"));                                                                    
            $data_string = json_encode($data); 
            
             "The Json Data : ".$data_string; 
            
            $headers = array
            (
                 'Authorization: key=' . API_ACCESS_KEY, 
                 'Content-Type: application/json'
            );                                                                                 
                                                                                                                                 
            $ch = curl_init();  
            
            curl_setopt( $ch,CURLOPT_URL, 'https://fcm.googleapis.com/fcm/send' );                                                                  
            curl_setopt( $ch,CURLOPT_POST, true );  
            curl_setopt( $ch,CURLOPT_HTTPHEADER, $headers );
            curl_setopt( $ch,CURLOPT_RETURNTRANSFER, true );
            curl_setopt( $ch,CURLOPT_POSTFIELDS, $data_string);                                                                  
                                                                                                                                 
           echo $result = curl_exec($ch);
            
            curl_close ($ch);
            
?>