Summary
You should now be able to convert a Blazor WebAssembly app into a PWA by adding a manifest file and a service worker.
In this chapter, we introduced PWAs. We explained how to convert a web app into a PWA by adding a manifest file and a service worker. We explained how to work with manifest files and service workers. We went into some detail explaining the different types of service workers and explained how to use the CacheStorage API to cache request/response pairs. Finally, we demonstrated how to use both the Geolocation API and the OpenWeather One Call API.
After that, we used the Empty Blazor App project template to create a new project. We added a JavaScript function that uses the Geolocation API to obtain our coordinates. We added some models to capture the coordinates and used JS interop to invoke the JavaScript function. We used the OpenWeather One Call API to obtain the local 5-day weather forecast and we created a couple of Razor components to display it.
...