Download the PHP package issetbv/push-notification without Composer
On this page you can find all versions of the php package issetbv/push-notification. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download issetbv/push-notification
More information about issetbv/push-notification
Files in issetbv/push-notification
Package push-notification
Short Description PushNotification is a push message abstraction which allows you to easily send push notifications to mobile devices. Currently we support Apple, Android and Windows (experimental)
License MIT
Homepage http://www.isset.nl
Informations about the package push-notification
IssetBV/PushNotification
PushNotification is a push message abstraction which allows you to easily send push notifications to mobile devices. Currently we support Apple, Android and Windows (experimental)
Why Yet Another Notification Package
- There are many packages out there that support mobile push notification, but most do not support an unified API.
- Some implementations were lacking flexible logging capabilities
- Most implementations did not support batches/queues
- Most implementations did not take into account that when sending batches to Apple, if one of the messages fails, the entire batch is dropped. This means that if you have a queue of 50 messages and the 3rd message fails, 47 messages will be dropped. This frustrated us to no end, so we build a simple yet effective fallback mechanism that will restart the batch from the first message after the failed one.
Goals
- Have a generic API for sending push notifications regardless of device.
- Have consistent output.
- Integrate well with other packages/frameworks.
- Have a flexible logging mechanism.
- Have build in queue mechanism.
- Have build in queue resume when dealing with batches (specifically sent to Apple).
Prerequisites
- PHP 7.0+
- cURL
Installation
Through Composer:
Integrations
At the moment we only support Symfony, since that's what we use, but feel free to create your own, and send us a PR with a link to your integration
- Symfony integration: https://github.com/Isset/pushnotification-bundle
Supported Devices
- Android
- Apple
- Windows (experimental)
Documentation
The bulk of the documentation is stored in the docs/index.md file in this package:
Read the Documentation
If you just want to send a message without using the NotificationCenter
here are some simple TL;DR
examples
Simple Android Example
To send a push notification to an Android device we first need to setup a connection. A connection needs a name
, api url
and your api key
. Lastly we need the device token of the device we want to send the message to.
Simple Apple Example
To send a push notification to an Apple device we first need to setup a connection. A connection needs a name
, api url
, location of the pem file
and the passphrase of the pem
file (if the pem
file has one). Lastly we need the device identifier of the device we want to send the message to.
When sending messages to Apple, the payload can have a specific key named aps
where we can specify that it should show a notification on the screen. For more information, visit the official Apple documentation regarding the message format.
Simple Windows Example
To send a push notification to a Windows device we first need to setup a connection. A connection only needs a name
. Differently than with Android or Apple, the Windows message needs the uri of your specific device to deliver the message.
All versions of push-notification with dependencies
guzzlehttp/guzzle Version ^6.2
phpoption/phpoption Version ^1.5
psr/log Version ^1.0