Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

This article doesn't mention what is in my opinion the worst part of iOS PWAs (or web development in general).

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.



This makes my blood boil. Safari is literally the IE of mobile. I don't get why Apple is making it so hard to deliver PWAs nicely?! I mean, they can fight it, but they'll at best delay the inevitable... Perhaps that's their game: delay until they have in place a system as lucrative as the app store but for PWAs.


Trust me, It made my blood boil too. I unfortunately let my anger get the best of me and ended up getting in an argument with an Apple engineer online where I said some things that I really regret.

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...


Funny how sometimes with software and the way it is distributed, we can either have a handful of engineers figure it out the first time and distribute it correctly, or let the rest of the world of engineers reinvent the tandem bicycle for the k+nth time. I'm glad they are working on it, sorry you had to go through that. Sounds like you are a super ninja though and did not mind the extra grapple. You know, I often send in feature requests and application feedback. Probably once a month to Apple, or a website, or some service, because that's how they get better. In the end, we are all somehow serving one another (it's not just clients and customers and experts) and I think that it's important to appreciate how we got here - meaningful conversation and discourse.


That is a painful experience. Hope you were compensated well in some way. One more thing, not limited just to Safari standalone mode: their CSS rotation animation was buggy as hell (maybe it still is). If you rotated more than 180 degs, the CSS engine would rotate in the opposite direction (basically, it would ignore the sign of the intended rotation and just take the shortest path to get from state A to B)! Only solution involved some very ugly JavaScript.


It's just a matter of priorities. Of course Google wants you to stay within the browser and of course Apple would prefer native apps.

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.


Oh god, please not another substandard / badly maintained embedded engine. One Microsoft Outlook was enough for history. Getting emails to look right was a pain for so long.


> embedded engine.

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.


From my research when I had this issue, (and i'm going from memory here, so forgive any inaccuracies) it looks like it's because Safari uses Safari's rendering engine, while WebView's use "WebKit" with a lot of modifications.

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.


I've been tracking this same "bug". do you have any sense for when webrtc will be in wkwebview? some thread somewhere said it's one full release lag behind when Safari gets a feature


No idea whatsoever.

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.


which webrtc feature did you need?


specifically `getUserMedia` access, we have a barcode scanning application that works entirely in JavaScript that needs access to the camera to work.


i'm waiting on the same feature :) i find it hard to believe it's a technical problem. i suspect it's politics around letting web apps having functional parity with native.


wow, that sounds frustrating! I hope they fix that. Is there no way to force something to open in safari?


There might be, but from past experience it wasn't a good idea to do so.

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...




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: