GithubHelp home page GithubHelp logo

likemusic / firebase-broadcast-driver-with-fcm Goto Github PK

View Code? Open in Web Editor NEW

This project forked from zeknoss/firebase-broadcast-driver-with-fcm

0.0 1.0 0.0 29 KB

A firebase broadcast driver for laravel (with FCM)

License: MIT License

PHP 100.00%

firebase-broadcast-driver-with-fcm's Introduction

FireBase Broadcast Driver
Latest Stable Version Total Downloads

Installation

  • composer require ctf0/firebase-broadcast-driver

  • the package internally use kreait/firebase-php to send data to firebase.

Config

// config/broadcasting

return [
    'connections' => [
        // ...

        'firebase' => [
            'driver'          => 'firebase',
            'type'            => 'firestore', // database, firestore or messaging
            'databaseURL'     => env('FB_DB_URL'), // the real time database url
            'creds_file'      => env('FB_CREDENTIALS_FILE'), // service account json file
            'collection_name' => env('FB_COLLECTION_NAME'), // ex.notifications
        ],
    ],
];

Usage

  • add BROADCAST_DRIVER=firebase to .env

  • atm there no support for laravel-echo "any help is appreciated" but no worries, you still get the same payload as other broadcast drivers.

    however you can check the firebase api docs or vuefire if you are using vue, on how to listen for changes and update your app users accordingly.

Notification Data Sample

{
    "notifications" : {
        "-LkgtAVVw0Ztwyjayd9n" : {
            "channel" : "private-App.User.091b0f7e-805b-4aab-8c99-445039157783",
            "data" : {
                "body" : "some body",
                "id" : "d54c44a2-8a42-43a4-bae0-e2b159d1533b",
                "title" : "some title",
                "type" : "App\\Notifications\\AlertUser"
            },
            "event" : "Illuminate\\Notifications\\Events\\BroadcastNotificationCreated",
            "timestamp": 1564183089538
        }
    }
}

Security

If you discover any security-related issues, please email [email protected].

firebase-broadcast-driver-with-fcm's People

Contributors

ctf0 avatar martijndb avatar zeknoss avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.