Our demo showcases how a Solid Pod, i. e. a web server that adheres to the Solid Protocol, can be extended to support Web Push Notifications for Progressive Web Applications (PWAs).
Authors: Christoph Braun, and Tobias Käfer from AIFB @ Karlsruhe Institute of Technology (KIT), Germany
Watch our video » Check out the live Demo » Get the code »Our demo showcases how a Solid Pod, i. e. a web server that adheres to the Solid Protocol, can be extended to support Web Push Notifications for Progressive Web Applications (PWAs). For a user’s perspective, we present a PWA where a user can choose to receive Web Push Notifications when a message is posted to her Solid Pod’s inbox.
Please find the submission here.
We have a live demo, where you can play around! For example, try the following:
Figure 1: Preview Screenshots of the inbox view with one message which a Push Notification was received for.
So, what happens in the background?
The following sequence diagram describes the Solid Web Push Notification scheme:
Figure 2: The Solid Web Push Notification scheme as a Sequence Diagram.
We model a Web Push subscriptions and the corresponding service on the SolidPod in RDF using the data model depicted below. We use CURIEs, abbreviated URIs, with prefixes from prefix.cc . We use push as prefix that is short for <https://purl.org/solid-web-push/vocab#>.
Figure 3: The data model underlying the Solid Web Push Notification scheme.
An example (in Turtle format) for the Solid Web Push Service profile is available here:
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>. @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>. @prefix dc: <http://purl.org/dc/terms/>. @prefix xsd: <http://www.w3.org/2001/XMLSchema#>. @prefix as: <https://www.w3.org/ns/activitystreams#>. @prefix ldp: <http://www.w3.org/ns/ldp#>. @prefix push: <https://purl.org/solid-web-push/vocab#>. <> a as:Profile; rdfs:label "The profile of the Solid Web Push Service"@en; as:summary """ The described resource is a Service called Solid Web Push. To subscribe to the service, post the subscription to the provided URI. The should indicate which resource the subscriber whishes to receive updates on (as:Follow, as:target) """; dc:creator <https://uvdsl.solid.aifb.kit.edu/profile/card#me>; as:describes <#web-push> . <#web-push> a as:Service; as:name "Solid Web Push"@en; rdfs:label "Solid Web Push Service"@en; ldp:inbox <https://solid.aifb.kit.edu/web-push/subscribe/>; push:vapidPublicKey "BAOxV1U1Hj5npToInct2VhhYpJkL0GmHqc-ADbHu7O8Z2CJNkqSzc8BfCStWbTKq_yT9B6g6kYjyEHrAEpVuqww"^^xsd:base64Binary.
And an example for canceling a subscription:
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix as: <https://www.w3.org/ns/activitystreams#> . @prefix push: <https://purl.org/solid-web-push/vocab#> . <#unsub> a as:Undo; as:actor <https://uvdsl.solid.aifb.kit.edu/profile/card#me>; as:object [ a as:Follow; as:actor <https://uvdsl.solid.aifb.kit.edu/profile/card#me>; as:object <https://uvdsl.solid.aifb.kit.edu/inbox/>; push:endpoint "https://fcm.googleapis.com/fcm/send/ezblK6NIv80:APA91bHrjqImGaqs5-kcIZ_zO72HVDHGfnrzi9xwJvSsHD3qu4js1nQfHvcjf1Fjgo3mpxBqMkFcqPdiaRPFXnYSkEf9yz78m9FFBaWzwIvmaQ8M1-2vxaAO3S-ha2jf7ALLqRP92Y9z"; push:keys [ push:auth "Z51Yn6DRglyzR6SpDYHkqw"; push:p256dh "BNocq-WqQufNxY5NtFWz-ckbLoCprrHT74ALR-DXcpCoKmqV2cVflQ6ibyas-vJBMWMLeSDPdRBbJhcc0lDmJ5g" ] ].
The current state of notification schemes in Solid are comprised of two alternatives:
Either the client relies on polling to detect updates on a resource independent of the Pod's implementation, or the client uses a WebSocket Subscription as defined in version v0.7.0 of the Solid Protocol (see here). As the WebSocket notification scheme is currently supported by the most used Pod implementations we rely on this scheme in our demo as a fallback when the user chooses not to receive push notifications.
Recently, the Solid Community Notification Panel started reworking Solid's notification protocol. Four notification schemes are currently proposed:
Web Push Notifications have been proposed in an IETF Draft for Generic Event Delivery using HTTP Push [6] and have been picked up by the W3C in the Push API [1]. Push Notifications are common-place in a typical PWA and are a feature that users expect, especially on mobile. With this demo, we propose an additional notification scheme of Solid Web Push Notifications in Pod-to-PWA fashion. where notifications can be received even when the application is closed.
The code of our server module is available on GitHub.
The code of our demo PWA is available on GitHub.