Install
Works with Drupal: 7.xUsing Composer to manage Drupal site dependencies
Downloads
Release notes
PWA 2
This new version has many improvements, and more configuration options. If you’re just starting with the PWA module, once you enable it you’ll have a PWA that is installable on mobile and a full score on the PWA lighthouse audit. You can try it out on simplytestme.
Before this version is stable:
- The modules doesn’t try to “guess” the assets for the of the offline pages (to be fixed before stable release)
- Impove configuration form widgets
Main improvements are:
- New WebPush sub-module, provide the API to let visitor register to push notifications, as well as a method to send push notification to subscribed users
- The serviceworker caching script uses the workbox library, it improve reliability and configurability of caching and caching strategies
- New API to extend the serviceworker script, lets other modules add capabilities in a simple way to the serviceworker
- Integration for Apple specific capabilities (off by default, splash screen, icons)
If you’re updating from version 1, while update hooks should do the job, be sure to check the settings around caching and precaching.
Major differences since version 1:
- The JavaScript to register the serviceworker is not added to all pages by default, an empty block which holds the javascript dependencies needs to be added to the page
- Make use of the new Clear-Site-Data HTTP header on user login and logout to clean up serviceworker data and prevent information disclosure
- The manifest file and serviceworker file are menu callbacks, there is no generated file anymore
- By default enabled for anonymous and logged in users
- Only icons for sizes 192×192 and 512×512 are added and are all “maskable”
- Default icon is the new evergreen icon (no more druplicon)
- Default colors and icons are taken from the Drupal Brand Book
- New administration pages, with a better information architecture, hopefully
- More granular permissions (administer manifest, administer serviceworker)
- The phone-home feature has been extended, checks are more frequent
Features:
-
PWA:
- Perfect lighthouse audit score
- clear storage url
-
ServiceWorker:
- The structure is simpler, the main file has a single JSON object holding the configuration and several importScripts calls that enable the different capabilites
- The HOOK_pwa_serviceworker_script_alter(&$scripts) can be used to add or remove capabilities
PWA WebPush
This submodule allow users to register to push notifications. Provide a rules action to send notifications
To install it you will need the web-push-php library. You can install it through composer_manager or if your website is not already using composer, it’s possible to do a composer install inside the PWA module folder.
The module provide a new table that holds the informations about push notification subscriptions.