Newer
Older
ournorth2021 / app / models / firebase-notificacion.php
LuisOlaya on 8 Apr 2021 1 KB primer
<?php
	//include("connect.php");
	
	$data = array(
		"accion" => "pop_up",
		"mensaje" => "En este momento estamos presentanto: Fibrosis Pulmonar Idiopática: Un asesino sin causa.", 
		"vista" => "live", 
		"microtime" => microtime()
	);                                                              
	$data_string = json_encode($data);                                                                                   
	                                                                                                                     
	$ch = curl_init('https://fora2020-b6f9b.firebaseio.com/notificaciones.json');                                                                      
	curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");                                                                     
	curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);                                                                  
	curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
	curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PUT");                                                                      
	curl_setopt($ch, CURLOPT_HTTPHEADER, array(                                                                          
	    'Content-Type: application/json',                                                                                
	    'Content-Length: ' . strlen($data_string))                                                                       
	);                                                                                                                   
	                                                                                                                     
	$result = curl_exec($ch);
	print_r($result);

	
?>