PHPackages                             simialbi/yii2-firebasemailer - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Mail &amp; Notifications](/categories/mail)
4. /
5. simialbi/yii2-firebasemailer

ActiveYii2-extension[Mail &amp; Notifications](/categories/mail)

simialbi/yii2-firebasemailer
============================

A PHP-client-library for using firebase component to send push notifications.

0.1.0(1y ago)146MITPHPPHP &gt;=8.2

Since Feb 26Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/simialbi/yii2-firebasemailer)[ Packagist](https://packagist.org/packages/simialbi/yii2-firebasemailer)[ RSS](/packages/simialbi-yii2-firebasemailer/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (3)Versions (2)Used By (0)

Firebase push notifications with yii2 framework
===============================================

[](#firebase-push-notifications-with-yii2-framework)

A lightweight PHP-client-library for using Firebase push notification services with [yii2 framework](https://www.yiiframework.com). Reduces the complexity of network-communication between client and SMS gateway, to help save time and money for focusing on their business logic.

[![Latest Stable Version](https://camo.githubusercontent.com/d2acea4be4e19ddc037f6a43196a844692ce9706aff85174fa7b919f5b2e479f/68747470733a2f2f706f7365722e707567782e6f72672f73696d69616c62692f796969322d66697265626173656d61696c65722f762f737461626c653f666f726d61743d666c61742d737175617265)](https://packagist.org/packages/simialbi/yii2-firebasemailer)[![Total Downloads](https://camo.githubusercontent.com/c54f48b9a27a2002549919d48f3dbfc85111fadb99e2296586a68fd68cea76c7/68747470733a2f2f706f7365722e707567782e6f72672f73696d69616c62692f796969322d66697265626173656d61696c65722f646f776e6c6f6164733f666f726d61743d666c61742d737175617265)](https://packagist.org/packages/simialbi/yii2-firebasemailer)[![License](https://camo.githubusercontent.com/7815b235accbb6e104942082a189fcb9e43a7ac9d2de61cb753454f97809c1e6/68747470733a2f2f706f7365722e707567782e6f72672f73696d69616c62692f796969322d66697265626173656d61696c65722f6c6963656e73653f666f726d61743d666c61742d737175617265)](https://packagist.org/packages/simialbi/yii2-firebasemailer)

Installation
------------

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

Either run

```
$ php composer.phar require --prefer-dist simialbi/yii2-firebasemailer

```

or add

```
"simialbi/yii2-firebasemailer": "^1.0.0"

```

to the `require` section of your `composer.json`.

Usage
-----

[](#usage)

In order to use this component, you will need to:

1. [Setup component](#setup-component) your application so that the module is available.

### Setup component

[](#setup-component)

```
return [
    // [...]
    'components' => [
        'firebase' => [
            'class' => 'simialbi\yii2\firebasemailer\Mailer',
            'firebaseCredentials' => [
                'type' => 'service_account',
                'project_id' => 'my_app',
                'private_key_id' => '4d95db2814a6e057611f7883a9a243f6',
                'private_key' => '-----BEGIN PRIVATE KEY-----\n...\n-----END PRIVATE KEY-----\n',
                'client_email' => 'firebase-adminsdk-fbsvc@my_app.iam.gserviceaccount.com',
                'client_id' => '000000000000000000001',
                'auth_uri' =>  'https://accounts.google.com/o/oauth2/auth',
                'token_uri' => 'https://oauth2.googleapis.com/token',
                'auth_provider_x509_cert_url' => 'https://www.googleapis.com/oauth2/v1/certs',
                'client_x509_cert_url' => 'https://www.googleapis.com/robot/v1/metadata/x509/firebase-adminsdk-fbsvc%40my_app.iam.gserviceaccount.com',
                'universe_domain' => 'googleapis.com'
            ],
            // 'requestOptions' => [
            //    'timeout' => 20,
            //    'proxy' => 'tcp://proxy.example.com:5100'
            // ]
        ]
    ]
];
```

Example Usage
-------------

[](#example-usage)

To send a message create a new `Message` instance and set at least the content and recipients.

```
