El siguiente código PHP para la notificación push de Onesignal funciona bien,
Pero, ¿cómo agrego Título a la notificación junto con un ícono personalizado definido en lugar de la campana predeterminada?
//Push Notifications Starts User -------------------------------------------------------------- notify("Alert","Your Order status has been changed to '$order_status'."); $content = array("en" => "Your Order status has been changed to '$order_status'."); $fields = array( 'app_id' => "fa0e5f20-xxxxxxxxxxxxxxxxxxxx", 'included_segments' => array('All'), 'contents' => $content, 'data' => array("en" => "bar"), 'large_icon' =>"ic_launcher_round.png", ); $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; charset=utf-8', 'Authorization: Basic NTBjNDExxxxxxxxxxxxxxxxxxxxxxxxxxxxx' )); 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); //Push Notifications Ends --------------------------------------------------------------Tenga en cuenta que "ic_launcher_round.png" está en mi SDK de estudio dentro de las carpetas "res->mipmap->ic_launcher_round"
El impulso está funcionando, pero necesito el título en la parte superior del contenido junto con 'ic_launcher_round.png' como ícono personalizado.
Cualquier ayuda es muy apreciada.