Hello,
For the last 2 years I am using the below function in my php to send messages successfully. Today I realized that none of my android apps receiving the messages sent via this code, messages sent directly from firebase console are receiving. the code is:
is stg changed I am unaware ?
For the last 2 years I am using the below function in my php to send messages successfully. Today I realized that none of my android apps receiving the messages sent via this code, messages sent directly from firebase console are receiving. the code is:
B4X:
function notify($r, $t, $m) {
// API access key from Google API's Console
if (!defined('API_ACCESS_KEY')) define( 'API_ACCESS_KEY', 'xxxxxxxx');
$tokenarray = array($r);
// prep the bundle
$msg = array(
'title' => $t,
'body' => $m,
'MyKey1' => 'MyData1',
'MyKey2' => 'MyData2',
);
$fields = array(
'registration_ids' => $tokenarray,
'data' => $msg
);
$headers = array(
'Authorization: key=' . API_ACCESS_KEY,
'Content-Type: application/json'
);
$ch = curl_init();
curl_setopt( $ch,CURLOPT_URL, '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 );
return $result;
}
is stg changed I am unaware ?