Hello help what I want is the following I am trying to send a notification to users of an app I know that this is done by means of token but that is my concern I do not want to send them by token I want to send it to all users they have the app installed on their device as per say per package as it is done from the firebase console .. here is my code
<?php
// API access key from Google API's Console
define( 'API_ACCESS_KEY', 'YOUR_FIREBASE_API_ACCESS_KEY' );
$registrationIds = [];
// prep the bundle
$msg = array
(
'body' => $valorDescripcion,
'title' => $valorTipo,
'vibrate' => 1,
'sound' => 1,
);
$fields = array
(
'registration_ids' => $registrationIds,
'notification' => $msg
);
$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_SSL_VERIFYPEER, false );
curl_setopt( $ch,CURLOPT_POSTFIELDS, json_encode( $fields ) );
$result = curl_exec($ch );
curl_close( $ch );
echo $result;
?>