New:Introducing Socket Scanning for VS Code Marketplace Extensions.Learn more →
Get Started

agent/firepush-php

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

agent/firepush-php

A PHP package for send real time push notification in client user agent with firebase

Source
Packagist
Version
dev-master
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

Push Message

Small PHP library for send Cloud Messaging

PHP VersionStatusRequire
PHP 7.2In DevComposer

Install Library:

composer require agent/firepush-php

Access Google Firebase Console

Firebase gives you functionality like analytics, databases, messaging and crash reporting so you can move quickly and focus on your users. (See Enable Project)

Start Agent Object:

$firepush = new Agent\Firepush\Service('AAAAWj6Hc4E:LONG-SERVER-CLOUD-MESSAGE-KEY');

💻 The class will connect via api to the project in console.firebase.google.com

Send Signle Device push notice to client

$firepush->to('client_token');

$notify = array(
           'title' => 'FCM Message',
           'body' => 'FCM Message Text',
           'icon' => 'http://myproject.com/icon.png',
           'link' => 'http://myproject.com'
         );

$firepush->notification($notify);
                    
$firepush->send();     

//or concatenate:

$firepush->to('client_token')->notification($notify)->send()
               

🚀 The system Send the notification in device set in to()

Send Multiple Device push notice to client


$clients_token = array(
// array of token to send
);

$firepush->to($clients_token);

$notify = array(
           'title' => 'FCM Message',
           'body' => 'FCM Message Text',
           'icon' => 'http://myproject.com/icon.png',
           'link' => 'http://myproject.com'
         );

$firepush->notification($notify);
                    
$firepush->send();     

//or concatenate:

$firepush->to($clients_token)->notification($notify)->send()
               

🚀 The system Send the notification in ALL device set in to array()

Retrive Single/Multiple Messages ID


CODE FOR SEND NOTIFICETION
                    
$firepush->send();     

// After send:

$firepush->getMessageIds();
               

🚀 The system retrive all message id from call

FAQs

Package last updated on 04 Feb 2022

Related posts