One Hat Cyber Team
Your IP :
18.191.237.209
Server IP :
50.28.103.30
Server :
Linux host.jcukjv-lwsites.com 4.18.0-553.22.1.el8_10.x86_64 #1 SMP Tue Sep 24 05:16:59 EDT 2024 x86_64
Server Software :
nginx/1.24.0
PHP Version :
8.3.12
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
www
/
wwwroot
/
globify.live
/
fns
/
push_notification
/
View File Name :
firebase.php
<?php require 'fns/push_notification/firebase_php/autoload.php'; use Kreait\Firebase\Factory; use Kreait\Firebase\Messaging\CloudMessage; use Kreait\Firebase\Messaging\Notification; if (!empty(Registry::load('settings')->firebase_private_key)) { $firebase_pkey = 'fns/push_notification/firebase_key/'.Registry::load('settings')->firebase_private_key; if (file_exists($firebase_pkey)) { $factory = (new Factory) ->withServiceAccount($firebase_pkey); $messaging = $factory->createMessaging(); $data['link'] = Registry::load('config')->site_url; $notification = Notification::create($data['title'], $data['message']); $message = CloudMessage::new()->withNotification($notification); try { $sendReport = $messaging->sendMulticast($message, $data['device_tokens']); $response = "Notification sent successfully!"; } catch (\Kreait\Firebase\Exception\MessagingException $e) { $response = "Error sending notification: " . $e->getMessage(); } $result = array(); $result['response'] = $response; } }