I'm developing a push notifications system for android, but I do not know how to change icone.I'm using php along with Firebase + Onesignal to develop. I'm developing a push notifications system for android, but I do not know how to change icone.I'm using php along with Firebase + Onesignal to develop.
<?php
if(isset($_POST['titulo'])){
function sendMessage(){
$content = array(
"en" => $_POST['mensagem']
);
$headings = array("en" => $_POST['titulo']);
$fields = array(
'app_id' => "Your APP_ID",
'included_segments' => array('All'),
'contents' => $content,
'headings' => $headings,
);
$fields = json_encode($fields);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://onesignal.com/api/v1/notifications");
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json',
'Authorization: Basic XXXXXXXXXXXXXXXXXXXXXXXXXXXX'));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_HEADER, FALSE);
curl_setopt($ch, CURLOPT_POST, TRUE);
curl_setopt($ch, CURLOPT_POSTFIELDS, $fields);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
$response = curl_exec($ch);
curl_close($ch);
return $response;
}
$response = sendMessage();
$return["allresponses"] = $response;
$return = json_encode( $return);
}
print_r($response);
if(isset($response) && !empty($response)){
header('Location: push.php?msg=ok');
}
?>