Server IP : 173.201.180.75 / Your IP : 18.232.179.37 Web Server : Apache System : Linux p3plzcpnl459188.prod.phx3.secureserver.net 2.6.32-954.3.5.lve1.4.92.el6.x86_64 #1 SMP Tue Jul 4 15:05:25 UTC 2023 x86_64 User : ryvm0idqv8fv ( 7659266) PHP Version : 7.3.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/ryvm0idqv8fv/public_html/ |
Upload File : |
<?php function FCM($Token,$Id='0',$Msg_Body,$Title="Crazy Money", $sound='default',$Image='',$Type='') { $sound = ''; $FCM_KEY = 'AAAAT9bQJho:APA91bG66zlZozmyXk-PBS16cmH2Q4rhrPZJT2w3E8RcG0xYZ9n2z5Jp9jpSEXzt5PXdCK4iGFpkaYr-I91jbJD6OpM0KufiX5b7ZW_llTX5z76a_pNB_LPy6MlMwFBPaAwZABfBgV7z'; $Msg_Body=ucfirst($Msg_Body); ob_start(); $notification = array( 'body'=> $Msg_Body, 'title' => $Title, 'sound'=>$sound, 'image'=>$Image, ); $data= array( 'title' => $Title, 'body' => $Msg_Body, 'idea_id' => $Id, 'Type' => $Type, 'Image' => $Image, ); if(is_array($Token)) { $arrayToSend = array( 'registration_ids'=>$Token, 'notification' => $notification, 'data'=> $data, 'priority'=>'high'); } else{ $arrayToSend = array( 'to'=>$Token, 'notification' => $notification, 'data'=> $data, 'priority'=>'high'); } $json = json_encode($arrayToSend); $headers = array(); $headers[] = 'Content-Type: application/json'; $headers[] = 'Authorization: key= '.$FCM_KEY; //server key here $ch = curl_init("https://fcm.googleapis.com/fcm/send"); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST"); curl_setopt($ch, CURLOPT_POSTFIELDS, $json); curl_setopt($ch, CURLOPT_HTTPHEADER,$headers); curl_exec($ch); $response = curl_exec($ch); print_r($response); curl_close($ch); ob_clean(); } // FCM($_POST['Device_Key'], $_POST['Idea_Id'], $_POST['Message']); ?>