Problem sending push notification from server to applications

Please provide the following:

  1. SDK Version: 35
  2. Platforms(Android/iOS/web/all): all

Problem sending push notification from server to applications.
I use curl to send the push notification message, this worked correctly but for a while now when sending the error message
{“error”: “invalid_token”, “error_description”: “The Authorization header bearer token format is invalid”}

The code used and that worked is this

/funcion que envia mensajes push/
public function enviarPush($token,$titulo,$contenido,$emisor=’’)
{

$tok=array($token);

$datosExtra->message=$emisor;
$data = array(“to” => $tok,“sound”=>“default”,‘title’=>$titulo,‘body’=>$contenido,‘channelId’=> ‘occo-messages’,“data”=>$datosExtra);

$headers = array(
“Authorization: key=AAAAfhb_HCk:APA91bEjMClSrudcm2yNRSEdrG17bpLliRGoVS4IrOshVyGaNcYDe88CMYh_0-nnHM-bNYMjCTU8pRekybmC_-FsYOgxev53CV9BMWIqFqh4Iw840zCx_3968b8f4_lWcpjtyJsFsKff”,
“Content-Type: application/json”,
“accept-encoding: gzip, deflate”

);

$ch = curl_init(‘https://exp.host/--/api/v2/push/send’);

curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, “POST”);
curl_setopt($ch, CURLOPT_POSTFIELDS,json_encode($data));

$response = curl_exec($ch);

curl_close($ch);
if(!$response) {
return false;
}else{
return $response;
}
}

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.