Advertisement
Zgragselus

Hand fcm

Mar 1st, 2024
640
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.44 KB | None | 0 0
  1. <?php
  2. require_once __DIR__ . '/vendor/autoload.php';
  3.  
  4. use phpFCMv1\Client;
  5. use phpFCMv1\Notification;
  6. use phpFCMv1\Recipient;
  7.  
  8. $client = new Client('service_account.json');
  9. $recipient = new Recipient();
  10. $notification = new Notification();
  11.  
  12. $recipient -> setSingleRecipient('DEVICE_TOKEN');
  13. $notification -> setNotification('NOTIFICATION_TITILE', 'NOTIFICATION_BODY');
  14. $client -> build($recipient, $notification);
  15. $client -> fire();
  16. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement