Progressive web apps are coming to iOS 11.3: Cupertino, we have a problem
medium.com
medium.com
The engine that runs a PWA (or web-view, or app added to the home screen) is completely different than the one in safari.
The "WebView" engine, (specifically a UIWebView, WKWebView, or SFSafariViewController) don't have some features turned on, like WebRTC. And there are rendering differences between the 2 engines.
I was really screwed by this recently. I saw iOS 11 was to get WebRTC and getUserMedia support, so I tested out a POC and found it worked in safari. So I started building it out in safari, mostly just turning on the feature if it was supported in safari, and when I went to go test a production version of the app added to the homescreen, it was failing.
Turns out It's not only not supported on the WebView, but it still advertises that it's supported, and you just need to catch the failure when you go to use it to know that it's not supported...
Now I either had to tell my users to REMOVE the bookmark on the homescreen if they were to use this new feature, and warn people to NEVER add the app to the homescreen as it would break the feature, or just forgo the feature entirely, which is what I ended up doing.
I might be wrong but iOS decided from the early days to separate safari and webview.
What would be interesting to know is if it is two different libs/renders/codebases or just degradation of features as op pointed out with webview, etc.
As far as I heard from various sources, they are in many ways completely separate codebases, and the reasoning is that since WebKit is very tightly integrated with the OS, it takes them much more time to include new features into WebKit than it does in Safari.
This is a B2B web-app, and in a previous version (more of a predecessor) we had it open in safari, and we found that people wouldn't ever close the tab they were using, leading to hundreds of open tabs.
It also means that if someone went to the home screen, they would have to tap "Safari" to get back, and in my experience they didn't know to do that, so they would just click the homescreen shortcut again, opening a fresh new tab, and need to sign-in again...
But it did almost really fuck up my job, because we had promised a client that functionality, and like 2 weeks away from delivering had to back out and go with a fallback plan of staying up all night for many nights those 2 weeks coding something in cordova that would give me similar results.
It ultimately was my fault for not testing the feature in the correct way before committing to it, and it did turn out good for me (although it's far from ideal, having getUserMedia in WebViews is ideal, and I will be switching to it the second it's available and stable), but it was not a good time...
But their financial motives don't discount from the pros and cons of their approach. If anything, we need both in order that both actually have a reason to keep advancing.
Native apps capture depth, webapps capture breadth.
I actually think they're both doing the right thing by their users even if I don't agree on each individual choice they make.
I was told by an Apple engineer that they are working on it, and that it was a technical limitation not a political one. But since big additions like that tend to only come in major version updates, I'm expecting iOS 12 or iOS 13 if it misses that release.
If all the above is true, I can’t say I’m too happy with the feature as a user and hope there’s a universal off switch buried in settings somewhere. If I choose to use a website over a native app it’s due to its ephemerality, so I have no interest in web apps that stay past their welcome.
If on the other hand the behavior is 100% opt in, that’s fine as long as I’m not shown banners trying to sell me on the PWA all the time.
https://developer.mozilla.org/en-US/docs/Web/API/Cache
Workbox is my team's (Google Web DevRel) library for making it easier to manage caches (there's lots of gotchas you can potentially encounter if you roll your own).
It's similar with the UI. First flat, then 3D, now back to flat. Its crazy.
Obviously the apps Apple shipped on the original iPhone were native apps.
Even before the official App Store was announced, developers reversed engineered their way to native apps.
It wasn’t a good look for Apple: it could create native apps but 3rd party developers couldn’t, especially game developers.
HTML5 wasn’t nearly as capable 10+ years ago as it is today and developers let it be known that wasn’t tenable.
Apparently allowing 3rd party native apps was the right thing to do.
https://developers.google.com/web/progressive-web-apps/check...
Check out the case studies for why businesses are (rightfully, IMO) interested in PWAs.
https://developers.google.com/web/showcase/2017/
Disclosure: I work on Google Web DevRel team
https://developers.google.com/web/showcase/2017/
Disclaimer: I work on Google Web DevRel, which owns developers.google.com/web
I don't use Android, but I've never seen this work using any browser on MacOS, Windows or iOS.
They'll even open in a seperated window.
Three dots > More tools > Add to Desktop
The only browser that gets everything correct is Samsung's default browser. This is pretty ridiculous and the hacks available with current APIs aren't very good compared to if these browsers worked properly with 100vh.
They also have a mailing list, and one of the things they asked before this SW work started was 'let us know how important this is to you and what your use cases are'. I bet they are still listening and that they would love feedback.
In many cases(including mine) it now makes more sense to go PWA first instead of native.
Twitter PWA: 600KB
Native Android Twitter: 23.5MB
https://developers.google.com/web/showcase/2017/twitter#lowe...
This has been a huge differentiator in countries where users are sensitive to data consumption, which is why you see many case studies about countries in India, Africa, etc. getting great traction with PWAs.
Disclaimer: I'm on Google Web DevRel team
If these catch on a big way, it'll be catastrophic for more underpowered devices. Modern web pages are already starting to get acutely uncomfortable to use on older iPhones, let alone older Android devices- we aren't yet at the point where performance levels are high enough that we can slap the equivalent of an electron wrapper on everything, smirk at users' devices' vanishing battery life and call it a day.
I currently use IndexedDB to store over 500mb of data on phones successfully in a B2B application.
The biggest issue in my experience is access to native "well optimized" APIs. (If I want a video feed, it causes significantly more battery draw to do it in a webview vs a native camera feed).
IndexedDB is subject to the same origin policy, so only javascript executed on my domain can access the data for my domain.
Combined with a good Content-security-policy means I'm in control of exactly what code gets to access those resources.
Any cookies would also be subject to XSS, unless they have the HTTP-Only flag set, in which case the whole point is not worth discussing because JavaScript cannot access it or even know it exists, so it would obviously be useless to any javascript.
Localstorage (and friends like WebSQL and IndexedDB) and Cookies serve different purposes, and having data in IndexedDB is no less "secure" than having it displayed on the page. In both cases an XSS attack means game over.
See link below for per-browser storage quota: https://developers.google.com/web/ilt/pwa/live-data-in-the-s...
Disclaimer: I work on Google Web DevRel
I have not encountered a single case where a web app offered a better experience than a native app.
There is a reasonable argument that it's cheaper to develop, allowing support for more platforms to be rolled out with less development time. That's the single reason that might be valid.
For companies with more reliable visitors, Native definitely has an edge in options, but if a company is trying to build feature and experience parity across platforms, much if that edge is dulled.
https://www.thurrott.com/windows/windows-10/135665/pwas-comi...
But also, consider that people don't seem to really download that many apps. Less than one a month. So I agree with you, in that users may be conditioned to expect a certain workflow, but it's not like it's a deeply ingrained habit that people are doing daily. Also, when you visit a site multiple times, the browser shows a pop-up offering to add the app to your homescreen. So it's low-friction onboarding.
https://techcrunch.com/2017/08/25/majority-of-u-s-consumers-...
Disclaimer: I work on Google Web DevRel
In many cases this doesn't really matter, but could very easily be a complete dealbreaker for someone trying to decide what to build.
React Native remains a hard sell for me. The idea behind it is that knowledge of React is where the learning curve is. Which is a flawed premise. React, itself, is dead simple. But ditching years of CSS and DOM knowledge and learning the React Native component API and quirks regarding iOS and Android? That's a massive hill to climb. Even with JavaScript by your side. I'd rather try Cordova+React if I had to. And if I truly wanted native performance, then it's Obj-C for me. Might as well suck it up and do it right in the first place.
The PWA is 233 kb compared to 148 MB iOS native app.
https://formidable.com/static/Formidable-Case_Starbucks_PWA....
Still not practical. APIs available to the web ecosystem are always going to be one level abstracted or behind their fully native counterparts.
Quite aside from anything else, the Starbucks PWA is a strictly worse experience than the native application.
We already have popups to log in, popups to sign up for newsletters, popups to take surveys, popups to install the app instead of viewing the website, full-screen ads, popups to enable notifications, popups for a site to access my location, popups about enabling cookies, and popups telling me to stop blocking popups. Every site now thinks just because I'm clicking on it from a search result page means I want to engage in some semipermanent relationship with them, before I even get a chance to view the site. Now we just add one more thing to the pile of things every website under the sun will try to get me to do just because I clicked one link.
Remember when web pages were just documents you could view?
Honestly? Fuck the web.
This article focuses on Web App Manifest, and Service Workers (Caching). Safari on macOS definitely has Service Workers, but I'm not sure Web App Manifest support on desktop (nor am I clear on how that would make sense)
Why would it not make sense? I was just thinking about giving macOS the same functionality as iOS (so "installing" web-pages), having them in the dock and giving them a different UI. I have some electron apps installed on my mac that don't need much more functionality and could just be converted to a PWA if supported on macOS.
https://developers.google.com/web/progressive-web-apps/check...
Disclosure: I work on Google Web DevRel, the team that owns that site