progressive-web-apps

Web Push notifications with iOS 11.3

只谈情不闲聊 提交于 2019-12-06 17:30:32
问题 With the release of iOS 11.3 and it's inclusion of service workers, I have been trying to find information about whether or not web push is also available now, particularly for the usage in PWA's. Does anyone have any knowledge on this or know where I can find the information. I Currently use Onesignal for my push notification package and it works very very well for browser and Android. So here is hoping that if it is supported now, they get it up and running fast. 回答1: Bad news : Apple has

service worker install event is called before register event is completed

不想你离开。 提交于 2019-12-06 14:45:17
I have attached install event to service worker as below. But Install event fired before register event is completed. See code snippets and console logs below. My concern is how install event is fired before register event is completed? if ('serviceWorker' in navigator) { navigator.serviceWorker.register('./service-worker.js',{scope : '/'}).then(function(registration) { // Registration was successful console.log('ServiceWorker registration successful with scope: ', registration.scope); }).catch(function(err) { // registration failed :( console.log('ServiceWorker registration failed: ', err); }

Check Service worker installation progress from component (angular)

假装没事ソ 提交于 2019-12-06 14:40:53
问题 I have updated my angular app into PWA, since I need to preload all of the assets on the first launch (application have a lots of images, which are used for UI). That's why I would like to show some kind of spinner/loading bar during service worker install event and hide it when it's done. So first question - is it possible to handle this event from the component? I have found this example and tried to add it inside first component, that loads on app launch, but didn't get any logs. So

How to enable offline support when using HTML5 history api

北慕城南 提交于 2019-12-06 12:17:35
问题 What are the best practices (and how to go about doing it) to support offline mode when using html5 history api for url rewrites? For example, (hypothetically) I have a PWA SPA application at https://abc.xyz which has internationalization built in. So when I visit this link, the Vue router (which ideally could be any framework - vue, react, angular etc.) redirect me to https://abc.xyz /en . This works perfectly when I am online (ofcourse, the webserver is also handling this redirect so that

How to Manage state between tabs in Flutter App

旧时模样 提交于 2019-12-06 10:29:06
I am using TabBar in my application where I need to get Input in first tab and show output based on some calculation on other tab. I am able to get input in first tab but when I click on second tab, my state is lost. I am not sure if I have to make it a Stateful widget at root level. I am relatively new in Mobile App. Can someone help me out here? EDIT: Now I am able to achieve what I said above, but when I am trying to access the list of items from first tab, it throws null exception in second tab? I solved the above problem using AutomaticKeepAliveClientMixin as described in the answer below

Progressive Web App: offline cache does not work on Android, it works on Chrome dev Tools

我是研究僧i 提交于 2019-12-06 08:20:45
问题 I have a simple PWA that works fine online. I have also tested the offline behaviour in Chrome Dev Tools, and the service worker is doing its job perfectly. But when I run the app from my Android phone, it doesn't work offline as the Cache Storage is no more present when offline. This is the service worker: var dataCacheName = 'myappData-v3n'; var cacheName = 'myapp-3n'; var filesToCache = [ '/meteosurf/', '/meteosurf/index.html', 'scripts/hammer.min.js', 'images/play_white.svg', 'images/stop

Multiple PWAs in the same domain

旧城冷巷雨未停 提交于 2019-12-06 07:50:54
Is it possible to host multiple PWAs under same endpoint. Say, I have three different PWAs Under root and then root should host these 3 PWAs in such a way that when I switch to any other apps via link or menu it shouldn't open in different window. Currently, it is getting opened in different window as web app whenever, I am clicking on different app. Thanks, Rahul You may refer with this thread . It stated that you can accomplish this with scoped apps. Update your manifest files to include a scope parameter with a value of the path that "app" should be served under. "scope": "/r/aizumap/", and

Web App Manifest not parsed by Chrome Dev Tools

不羁岁月 提交于 2019-12-06 04:08:06
I have a manifest.json according to the MDN spec and while it works correctly when browsing the website from a mobile device (add to homescreen popup shows up, theme color and icons load...etc) Chrome Dev Tools is unable to parse it. The same problem persists on Lighthouse (chrome extension). Has anyone seen a similar issue? I would think that the JSON is invalid however copy-pasting into Web App Validator it is marked correct, but when inputting the URL it giving a parse error: File isn't valid JSON: SyntaxError: Unexpected token in JSON at position 0 It is probably a BOM character issue in

Redirection in progressive web app

别说谁变了你拦得住时间么 提交于 2019-12-06 04:05:44
问题 I am trying to redirect to a particular url in progressive web app on notification click but it does not redirect. Case 1: If the web app is not added to home screen then on notification click the browser window opens up and is redirected to the desired url. Case 2: If the web app is added to home screen then the landing page is the home page and not the desired url. self.addEventListener('notificationclick', function(event) { event.notification.close(); event.waitUntil( clients.matchAll({