Download the PHP package rich2k/pusher-beams without Composer
On this page you can find all versions of the php package rich2k/pusher-beams. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download rich2k/pusher-beams
More information about rich2k/pusher-beams
Files in rich2k/pusher-beams
Package pusher-beams
Short Description Pusher Beams is a push notification service from Pusher.
License MIT
Homepage https://github.com/Rich2k/pusher-beams
Informations about the package pusher-beams
Pusher Beams - push notifications for Laravel
This package makes it easy to send Pusher push notifications with Laravel (should work with other non-laravel PHP projects). It's based off this package by Mohamed Said.
This fork exists to allow us to run both the Pusher Beams and old Pusher Channels code side by side.
Contents
- Installation
- Setting up your Pusher account
- Configuration
- Usage
- Available Message methods
- Testing
- Security
- Contributing
- Credits
- License
Installation
You can install the package via composer:
You must install the service provider:
Setting up your Pusher account
Before using this package you should set up a Pusher account. Here are the steps required.
- Login to https://dash.pusher.com/
- Select Beams from the side bar, and click Create from the right to create your Instance.
- Go to the settings tab (you can close the wizard)
- Upload your iOS .p8 auth key (they guides you through this), your iOS Team Id and/or your CM server key.
- Now select the Credentials tab.
- Copy your instanceId and SecretKey.
- Update the values in your
config/broadcasting.php
file under the pusher connection, see below. - You're now good to go.
Configuration
In config/broadcasting.php
Usage
Now you can use the channel in your via()
method inside the Notification
class.
Available Message methods
platform('')
: Accepts a string value ofiOS
orAndroid
.iOS()
: Sets the platform value to iOS.android()
: Sets the platform value to Android.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. For more information check here for iOS, or here for Android.withiOS(PusherBeamsMessage $message)
: Set an extra message to be sent to iOSwithAndroid(PusherBeamsMessage $message)
: Set an extra message to be sent to Android
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:
Routing a message
By default the Pusher beams "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 routeNotificationForPusherPushNotifications()
in the notifiable class method that returns the interest name.
Whatever interest you set in the app is the interest you should register for within your mobil
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
- Richard Hyland
- Neo Ighodaro
- Mohamed Said
- All Contributors
License
The MIT License (MIT). Please see License File for more information.
All versions of pusher-beams with dependencies
illuminate/events Version ^6.0 || ^7.0 || ^8.0 || ^9.0 || ^10.0
illuminate/notifications Version ^6.0 || ^7.0 || ^8.0 || ^9.0 || ^10.0
illuminate/queue Version ^6.0 || ^7.0 || ^8.0 || ^9.0 || ^10.0
illuminate/support Version ^6.0 || ^7.0 || ^8.0 || ^9.0 || ^10.0
pusher/pusher-push-notifications Version ^2.0