dev-master
9999999-devPSR7 Middleware for handling push notifications
MIT
The Requires
The Development Requires
by Jeremy Giberson
Wallogit.com
2017 © Pedro Peláez
PSR7 Middleware for handling push notifications
PSR7 middleware for handling push notifications. Detects push notifications and triggers a push notification event., (*1)
The middleware checks to see if it recognizes the incoming HTTP request as a push notification. If the request is recognized an appropriate event is dispatched. If the request is not recognized the next middleware is called., (*2)
By default when a push notification request is handled the middleware chain
is terminated. That is, even if the request is pointed to a valid route like
/do/something/route or even /, that route functionality will not be executed., (*3)
request -> push notification middleware
if request is recognized push notification
-> dispatch notification event
-> return 200 response
else
-> return $next_middleware(request, response)
Ideally, you will add notification event subscribers to the event dispatcher you factory the middleware with. These listeners will do interesting things when a push notification arrives., (*4)
The default, (*5)
The library provides support for some common services that provide push notifications., (*6)
http://docs.aws.amazon.com/sns/latest/dg/SendMessageToHttp.html, (*7)
https://developer.github.com/webhooks/#events, (*8)
https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/web_hooks/web_hooks.md, (*9)
https://api.slack.com/outgoing-webhooks, (*10)
https://wiki.jenkins-ci.org/display/JENKINS/Notification+Plugin, (*11)
Write a matcher that implements MatcherInterface and you can support any notification., (*12)
PSR7 Middleware for handling push notifications
MIT