PWA (Progressive Web App) with WorkBox Support
See original GitHub issueI’m looking for guidance on this more than trying to report a bug or request a feature. We’ve built a PWA that uses WorkBox which handles the offline support.
import React from 'react';
// import { SafeAreaView, StyleSheet } from 'react-native';
import WebView from 'react-native-webview';
const App = () => (
<WebView
source={{ uri: 'http://localhost:5000' }}
contentInsetAdjustmentBehavior='automatic'
/>
);
export default App;
When using the code above if my localhost:5000 is running, we are golden. When the local servers is ended; on Chrome browser the site works with its offline support but ReactNative application produces an error (see below).
Are there any polyfills that could help with this, is this mainly a limitation to the WebView. It seems cache is supported by default, what is the expectation?
The main goal is to leverage our PWA and get it on the APP store we do want to introduce some push notifications for iOS as well.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:6
- Comments:15
Top Results From Across the Web
Workbox - web.dev
Workbox aims to make using service workers as easy as possible while allowing the flexibility to accommodate complex application requirements where needed.
Read more >Ultimate Guide to PWAs with Workbox
This post is a complete guide to building a Progressive Web App (PWA) from the beginning using Google's Workbox. By the end of...
Read more >Progressive Web Apps: Working with Workbox
Welcome. In this lab, you'll take website with an existing service worker and convert it to using Workbox. This is the second in...
Read more >Getting started with progressive web applications through ...
In this tutorial, we're going to explore how to make web applications work offline through the use of service workers generated from Workbox...
Read more >Build a PWA using Workbox - Medium
... app as Progress Web App (PWA), configure services worker for caching strategies, and offline support using Workbox. The app will simply…
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I believe it would be helpful to keep this issue open as as far as I know it hasn’t been resolved yet. I believe this is an Apple SDK issue or I would try to submit a PR to fix it.
On Fri, Feb 28, 2020 at 7:09 PM github-actions[bot] < notifications@github.com> wrote:
Maybe, it’ll be helpful. So, on iOS 14+, wkwebiew has service workers and cache API To support Android and iOS, you need:
<WebView .... cacheEnabled={true} cacheMode={isInternetReachable ? 'LOAD_DEFAULT' : 'LOAD_CACHE_ONLY'} limitsNavigationsToAppBoundDomains={true} ... />
<key>WKAppBoundDomains</key> <array> <string>your-website.com</string> </array>