This is just a html, css website that implements PWA with service worker and web application manifest.
In this sample code you can check out how to cache your site styles and scripts and also how to have a progressive web app that can be installed in android devices like a native app with shorcut in home screen.
You can view the demo app in your mobile's chrome app https://pusheco.github.io/pushe-pwa-demo
, and after opening the web page after a couple of seconds
a dialog will appear in the bottom of your page, and if you click on that you can install the PWA app and the shortcut will appear in your home screen!
Important Note:
In order to use the PWA specific service worker and web notification service worker in the root scope (/) we would
import both servcie worker in pushe-sw.js
service worker.
clone the project git clone [email protected]:pusheco/pushe-pwa-demo.git
then cd pushe-pwa-demo
and then you can use any http webserver to run
the project in your local machine and check out the page in your browser.
To test the Pushe webpush functionality in the PWA we have already added the webpush scripts and codes into this app and also customized the subscription dialog, so to use it just accept the subscription dialog when it appears in your opended pwa app.