web-push: Send messages using Web Push protocol.

[ library, mit, web ] [ Propose Tags ]

Please see README.md


[Skip to Readme]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

Versions [RSS] 0.1.0.0, 0.1.2.0, 0.3
Dependencies aeson, base (>=4.7 && <5), base64-bytestring (>=1.0.0.1 && <1.1), binary (>=0.7.5 && <0.9), bytestring (>=0.9 && <0.11), cryptonite (>=0.21 && <0.22), exceptions (>=0.8.3 && <0.9), http-client (>=0.5.7 && <0.6), http-types (>=0.8.6 && <1.0), jose (>=0.5.0.4 && <0.6), memory (>=0.14.5 && <0.15), mtl (>=2.2.1 && <2.3), random (>=1.1 && <1.2), text (>=0.11 && <2.0), time, transformers (>=0.5.2.0 && <0.6), unordered-containers [details]
License MIT
Copyright 2017 Sarthak Bagaria
Author Sarthak Bagaria
Maintainer neokits@gmail.com
Category Web
Home page https://github.com/sarthakbagaria/web-push#readme
Source repo head: git clone https://github.com/sarthakbagaria/web-push
Uploaded by sarthakbagaria at 2017-06-17T19:18:11Z
Distributions
Reverse Dependencies 1 direct, 0 indirect [details]
Downloads 1670 total (11 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2017-06-17 [all 1 reports]

Readme for web-push-0.1.2.0

[back to package description]

web-push

Helper functions to send messages using Web Push protocol.

Usage

The sendPushNotification function encodes the message into Base64 URL form before encrypting and sending. Decode the message in Service Worker notification handler in browser before trying to read the JSON message.

Guides to using Web Push API in browsers can be found on Mozilla's and Google's docs, or you can check out this untested Yesod app demonstrating the use of this library.

To Do

  • Add recognition of more error/status codes from send notification HTTP response.
  • Clearly differentiate between ByteString encodings (Raw, Base64URL etc).
  • Extend tests to verify that push messages are sent properly.

References

Current implementation is based on the following versions of the drafts: