2017 © Pedro Peláez
 

symfony-bundle notifications-bundle

Implement notifications system in your symfony project using Pusher API

image

mrad/notifications-bundle

Implement notifications system in your symfony project using Pusher API

  • Tuesday, June 5, 2018
  • by mradmrad
  • Repository
  • 2 Watchers
  • 5 Stars
  • 36 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 3 Forks
  • 0 Open issues
  • 6 Versions
  • 64 % Grown

The README.md

NotificationsBundle

A simple implementation for Pusher API that helps you integrate a notifications system in a few simple steps., (*1)

Installation

  1. composer require mrad/notifications-bundle
  2. Enable the bundle in AppKernel.php new SBC\NotificationsBundle\NotificationsBundle(),

Usage

Step 1:

First thing you need to create an account with Pusher and then in Your apps menu create a new app., (*2)

Step 2:

Add you app configuration to the app/config.yml:, (*3)

# NotificationsBundle configuration
notifications:
    app_id:     your_id
    app_key:    your_key
    app_secret: secret
    cluster:    cluster
    # Optional
    # Default false: work without ssl encryption
    # Set it to true to work with ssl encryption
    encrypted:  false

Of course you can find those details in your app in the dashboard.
alt text, (*4)

Step 3:

Now in your view.html.twig (your client side) add this:, (*5)

{# Call NotificationsBundles's assets #}
{{ notifications_assets() }}





And that's it :smiley:, now to make sure that your client is receiving the data correctly you can test it by calling this console command:
php bin/console notifications:trigger "Your message" "channel"
If you open the browser's console you should see something like this:
alt text, (*6)

Broadcast custom messages from Backend

To broadcast messages from your backend you can simply do this:, (*7)

// From your controller or service
$data = array(
    'my-message' => "My custom message",
);
$pusher = $this->get('mrad.pusher.notificaitons');
$channel = 'messages';
$pusher->trigger($data, $channel);

// or you can keep the channel pram empty and will be broadcasted on "notifications" channel by default
$pusher->trigger($data);

Next Step

Now I will show how to create and save notifications in database. * Create and persist notifications, (*8)

License

This project is under the MIT license, (*9)

Videos

You can check this playlist for more details about how This bundle works., (*10)

Thanks

Thanks to SlimenTN for his help in this project, (*11)

The Versions

05/06 2018

dev-master

9999999-dev

Implement notifications system in your symfony project using Pusher API

  Sources   Download

MIT

The Requires

 

by Haithem Mrad
by Slimen Arnaout

pusher notificaiton bundle symfony notifications

11/05 2018

v1.2.2

1.2.2.0

Implement notifications system in your symfony project using Pusher API

  Sources   Download

MIT

The Requires

 

by Haithem Mrad
by Slimen Arnaout

pusher notificaiton bundle symfony notifications

05/05 2018

v1.2.1

1.2.1.0

Implement notifications system in your symfony project using Pusher API

  Sources   Download

MIT

The Requires

 

by Haithem Mrad
by Slimen Arnaout

pusher notificaiton bundle symfony notifications

30/04 2018

v1.2.0

1.2.0.0

Implement notifications system in your symfony project using Pusher API

  Sources   Download

MIT

The Requires

 

by Haithem Mrad
by Slimen Arnaout

pusher notificaiton bundle symfony notifications

07/03 2018

v1.0.1

1.0.1.0

Implement notifications system in your symfony project using Pusher API

  Sources   Download

MIT

The Requires

 

by Haithem Mrad
by Slimen Arnaout

pusher notificaiton bundle symfony notifications

07/03 2018

v1.0.0

1.0.0.0

Implement notifications system in your symfony project using Pusher API

  Sources   Download

MIT

The Requires

 

by Haithem Mrad
by Slimen Arnaout

pusher notificaiton bundle symfony notifications