Download the PHP package laravel-notification-channels/pusher-push-notifications without Composer
On this page you can find all versions of the php package laravel-notification-channels/pusher-push-notifications. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download laravel-notification-channels/pusher-push-notifications
More information about laravel-notification-channels/pusher-push-notifications
Files in laravel-notification-channels/pusher-push-notifications
Package pusher-push-notifications
Short Description Pusher native Push Notifications driver.
License MIT
Homepage https://github.com/LaravelNotificationChannels/pusher-push-notifications
Informations about the package pusher-push-notifications
Pusher Beams push notifications channel for Laravel 8.x & 9.x
This package makes it easy to send Pusher Beams push notifications with Laravel.
Please note that this notification channel should not be confused with Pusher Channels.
Also please note that prior to version 2.0, this package integrated with Pusher's beta push notifications service that was part of Pusher Channels. Please see Pusher's migration guide for more information.
Contents
- Pusher Beams push notifications channel for Laravel 8.x & 9.x
- Contents
- Installation
- Setting up your Pusher account
- Usage
- Available Message methods
- Sending to multiple platforms
- Routing a message
- Publish to users
- Changelog
- Testing
- Security
- Contributing
- Credits
- License
Installation
You can install the package via composer:
Setting up your Pusher account
Before using this package you should set up a Pusher Beams account. Here are the steps required.
- Login to https://dash.pusher.com/
- Select the "Beams" product.
- Select your instance from the list or create a new instance.
- Click on the "Settings" tab.
- Upload your APNS Certificate and/or add your FCM Server key.
- Now select the "Keys" tab.
- Copy your
Instance Id
, andSecret Key
. -
Add a new entry to in your
config/services.php
file: - You're now good to go.
Usage
Now you can use the channel in your via()
method inside the Notification class.
Available Message methods
platform('')
: Accepts a string value ofiOS
,Android
orweb
.iOS()
: Sets the platform value to iOS.android()
: Sets the platform value to Android.web()
: Sets the platform value to web.link()
: Accepts a string value which will lead to URI specified on notification click.title('')
: Accepts a string value for the title.body('')
: Accepts a string value for the body.sound('')
: Accepts a string value for the notification sound file. Notice that if you leave blank the default sound value will bedefault
.icon('')
: Accepts a string value for the icon file. (Android Only)badge(1)
: Accepts an integer value for the badge. (iOS Only)setOption($key, $value)
: Allows you to set any value in the message payload. See the request body section of the Pusher Beam docs for more information.
Sending to multiple platforms
You can send a single message to an iOS device and an Android device at the same time using the withiOS()
and withAndroid()
method:
- Notice that iOS is the default platform, which means you don't have to call
->iOS()
.- When using
withAndroid()
,withiOS()
orwithWeb()
you don't have to define the platform, it's done behind the scenes for you.
Routing a message
By default, the pusher "interest" messages will be sent to will be defined using the {notifiable}.{id} convention, for example App.User.1
,
however you can change this behaviour by including a routeNotificationFor()
in the notifiable class.
I.e. if you are pushing notification on User
model, you can go to App\Models\User
class and implement method:
PusherPushNotifications()
in the notifiable class method returns the interest name.
Publish to users
You can publish to users in the same way that you publish to interests but you must add the following variable to the notifiable model:
Changelog
Please see CHANGELOG for more information what has changed recently.
Testing
Security
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
Contributing
Please see CONTRIBUTING for details.
Credits
- Mohamed Said
- Marcel Pociot
- Freek Van der Herten
- Sebastian De Deyne
- All Contributors
License
The MIT License (MIT). Please see License File for more information.
All versions of pusher-push-notifications with dependencies
illuminate/events Version ~8.0 || ~9.0 || ^10.0 || ^11.0
illuminate/notifications Version ~8.0 || ~9.0 || ^10.0 || ^11.0
illuminate/queue Version ~8.0 || ~9.0 || ^10.0 || ^11.0
illuminate/support Version ~8.0 || ~9.0 || ^10.0 || ^11.0
pusher/pusher-push-notifications Version ^2.0