News for hackers. Stuff that matters.
Re:I built a progressive web app and published it in three a... by judah on Monday April 16, 2018 @11:55AM (#16849864)
Author here. Thanks all for bringing this to the HN front page.

The jist of the article is getting a PWA into the app stores is harder than it needs to be, especially on iOS. Between Google, Apple, and Microsoft, I found Google's Play Store to be the simplest and quickest store to get a PWA published in.

Another interesting bit is that web technologies haven't caught up to native. My PWA isn't super complex -- it's a glorified music player -- and yet integrating into the OS (now playing song on the lock screen, for example) was painful and non-standard, particularly on iOS.

All that said, I'm quite excited about PWAs. I think they will win in the long run, and will eventually (~5 years) become the dominant type of app in mobile and desktop app stores.

Re:I built a progressive web app and published it in three a... by al2o3cr on Monday April 16, 2018 @01:23PM (#16850821)

    I think they will win in the long run, and will eventually
    (~5 years) become the dominant type of app in mobile and
    desktop app stores.
Am I the only one who remembers people saying this EXACT thing about Java Swing apps? Not saying it's impossible, but "Write Once Run Anywhere" has been a mirage "just over the horizon" for a long time.
Re:I built a progressive web app and published it in three a... by judah on Monday April 16, 2018 @01:38PM (#16850973)
Author here.

Maybe Java fans, or Sun/Oracle employees and fanboys said that. That doesn't really mean much.

I did predict years ago that open web technologies will destroy native (desktop) apps, Flash, and Silverlight. In hindsight, I was correct.

I am predicting the same thing with regards to native mobile apps: they will largely disappear, and web apps will again win.

Re:I built a progressive web app and published it in three a... by scarface74 on Monday April 16, 2018 @01:52PM (#16851116)
Well actually no. Mobile destroyed Flash and Silverlight and all of the complex apps that were moved to mobile went native - like Netflix.
Re:I built a progressive web app and published it in three a... by judah on Monday April 16, 2018 @03:52PM (#16852126)
You're right that mobile did help kill plugins. But that was the final blow; HTML5 had already disrupted native apps on desktop OS for a few years, and as browsers picked up HTML5 support, there was almost no need for plugins.

(I say this with first-hand knowledge: several years ago when plugins were still common, I gave the final talk to a Silverlight user group in Minneapolis, in which I told the crowd there was simply no reason to continue using plugins. HTML5 won, and mobile only finalized its success.)

Just as open web technologies ate Microsoft's lunch, undermining the domination of Windows, I predict the same will be true of the Apple (and Google) app ecoysystems. More and more, operating systems are simply environments in which to run web browser. I believe this trend will continue.

Re:I built a progressive web app and published it in three a... by scarface74 on Monday April 16, 2018 @04:10PM (#16852264)
The original iPhone cams out in 2007. Flash and Silverlight was still big.

As late as 2010, Apple was still getting beat up about the iPad not supporting Flash.

HTML 5 was not popular a "few years before 2007". Android users were still touting being able to (barely) use Flash as late as 2010.

It also wasn't "open jtechnologies" that caused Windows to be less relevant. Windows still commands 85-90% plus of the desktop. Mobile caused the desktop to be less relevant.

Re:I built a progressive web app and published it in three a... by HillaryBriss on Tuesday April 17, 2018 @11:03AM (#16858958)
> I am predicting the same thing with regards to native mobile apps: they will largely disappear, and web apps will again win.

But, how do you reconcile this belief with the ample evidence you offer that Apple/iOS are dragging their feet and are resistant (for whatever internal reasons) to letting PWAs offer a first class experience?

In other words, what forces, in your view, will eventually bring Apple over to full support for PWAs?

Re:I built a progressive web app and published it in three a... by iandev on Monday April 16, 2018 @12:26PM (#16850211)
In the article: "Aside: I guess Apple won’t let you submit an app unless you have a registered, legal company?"

Although it does seem to be this way, you can submit an app to the store without being a registered, legal company. The most common route is to just mark yourself as a sole proprietorship using your own name. No need for an LLC or anything. However, this may vary from country to country.

Re:I built a progressive web app and published it in three a... by saagarjha on Monday April 16, 2018 @04:39PM (#16852537)
Can confirm: in the US, you don't need to get a DUNS number at all, if you're selling individually.
Re:I built a progressive web app and published it in three a... by KeepFlying on Tuesday April 17, 2018 @05:47PM (#16862602)
This is correct, but you must list your full legal name as the store listing, which isnt very ideal in my opinion. In order to list it as a business name you need an LLC or more. No Sol Proprietors allowed.
Re:I built a progressive web app and published it in three a... by SeanLockItUp on Monday April 16, 2018 @12:30PM (#16850261)
I don't think that's true?

I had to get a DUNS number to apply to the app store. And it had to be an LLC (I think?) and not a sole proprietorship.

I initially just wanted to use a "DBA" (doing business as) but they don't allow those anymore, they used to in the early days but no longer.

Re:I built a progressive web app and published it in three a... by iandev on Monday April 16, 2018 @12:42PM (#16850385)
According to this: https://developer.apple.com/support/enrollment/

A DUNS number is only required for organizations, not individuals.

Re:I built a progressive web app and published it in three a... by SeanLockItUp on Monday April 16, 2018 @08:24PM (#16854302)
ah fair enough, yea I wanted an LLC because everyone told me to be smart and not use my real name and have no legal protections.

I suppose I could have just used my name though.

Re:I built a progressive web app and published it in three a... by wpietri on Monday April 16, 2018 @02:08PM (#16851272)
Those who are skeptical should try out Twitter Lite, the PWA version of Twitter. Developer blog here:

https://blog.twitter.com/engineering/en_us/topics/open-sourc...

I've been using it on Android for a while. It's not perfect, but it's definitely good enough. There are still plenty of apps where I'd tell a CEO, "No, we really need three sets of client developers," but the number is certainly dropping over time.

Re:I built a progressive web app and published it in three a... by yoz-y on Wednesday April 25, 2018 @03:32AM (#16919285)
I tried it just now. When I put my phone into airplane mode it just shows "Twitter is taking too long to load", I do have iOS 11.3 so service workers should handle this.
Re:I built a progressive web app and published it in three a... by cm2187 on Monday April 16, 2018 @12:22PM (#16850164)
I excited by the combination webassembly+pwa, which should enable truly cross platform, language agnostic, client development.
Re:I built a progressive web app and published it in three a... by judah on Monday April 16, 2018 @12:32PM (#16850286)
I think PWAs will win in the long run, regardless of WebAssembly. Both are exciting technologies, though, and WebAssembly will help bring performance in line with native.
Re:I built a progressive web app and published it in three a... by geekles on Monday April 16, 2018 @03:13PM (#16851837)
The point of a PWA is that the app store is not needed. Why would you be trying to get a PWA into the app store?
Re:I built a progressive web app and published it in three a... by judah on Monday April 16, 2018 @04:33PM (#16852476)
I answer that in the post. The short of it is, because 1) that's where users look for apps and 2) Apple greatly restricts web apps in Safari. So much so that to be first-class citizen, you need to be an app in the store.
Re:I built a progressive web app and published it in three a... by osrec on Monday April 16, 2018 @12:20PM (#16850136)
I'm interested to know how did you actually integrate with the lock screen? Did you use a wrapper of some kind to access native functionality?
Re:I built a progressive web app and published it in three a... by judah on Monday April 16, 2018 @12:27PM (#16850224)
I describe that in the article, but here's the short of it:

iOS: You have to use Cordova plugins. I used RemoteCommand[0] and NowPlaying[1] that lets me write JavaScript that calls into native iOS functionality. Once the Cordova plugins are installed, you write JS to talk to them. Source code for that here[2].

Android: Google has submitted a web standard[3] for this. Integrating with it is simple[4].

Windows: Microsoft automatically injects the Windows API into the JS global namespace. So you write JavaScript that looks like window.Windows.Media.SystemMediaTransportControls.doSomethingHere(). You can see the code for that here[5].

[0]: https://github.com/leon/cordova-plugin-remotecommand

[1]: https://github.com/leon/cordova-plugin-nowplaying

[2]: https://github.com/JudahGabriel/Chavah/blob/master/Chavah.Ne...

[3]: https://developer.mozilla.org/en-US/docs/Web/API/Media_Sessi...

[4]: https://github.com/JudahGabriel/Chavah/blob/master/Chavah.Ne...

[5]: https://github.com/JudahGabriel/Chavah/blob/master/Chavah.Ne...

Re:I built a progressive web app and published it in three a... by osrec on Monday April 16, 2018 @12:31PM (#16850271)
Thank you! That was very informative (sorry for only skimming the article earlier). So Android and Windows don't require a wrapper, but iOS needs Cordova. I'm sure iOS will catch up soon enough...
Re:I built a progressive web app and published it in three a... by tangue on Monday April 16, 2018 @12:23PM (#16850179)
Me too I didn't suspect that was even possible. If it's not a hack maybe PWA are not that far from mainstream.
Re:I built a progressive web app and published it in three a... by judah on Monday April 16, 2018 @12:30PM (#16850252)
It's possible. But you currently have to write code for each platform; iOS uses a Cordova plugin for this, so your JS has to talk to Cordova. Windows uses its own proprietary namespace which is injected into your app, so you write JS that talks to the proprietary Windows API.

Google is the unique bright light here. They've submitted a web standard, navigator.mediaSession [0], that lets you do this in a web standard way. Unfortunatly, the only browser that implements it is Chrome on Android.

[0]: https://developer.mozilla.org/en-US/docs/Web/API/Media_Sessi...

Re:I built a progressive web app and published it in three a... by ihuman on Monday April 16, 2018 @12:01PM (#16849940)
[Removed by user]
Re:I built a progressive web app and published it in three a... by judah on Monday April 16, 2018 @12:08PM (#16850010)
Why build an app and not just live on the web? I answered that in the article, 2nd paragraph. The answer is two-fold:

1. That's where users are. We've trained a generation of users to find apps in app stores.

2. Some mobile platforms (read: iOS) are hostile to web apps. For example, Apple doesn't let you play audio in the background on iOS. (Or rather, they suspend JS execution if the web app is in the background, or if the screen is off. Thus, you can play exactly a single MP3, then my media player app will stop playing music unless it's still in the fore, which is a show-stopper.) This is just one of dozens of issues with web audio in iOS Safari; I've documented more here[0].

Native apps have no such restriction. Thus, packaging my PWA as an app got around all these restrictions. Plus it lets me integrate with the OS, for example, by showing the currently-playing song name, artist, album, art, etc. on the lock screen.

[0]: http://debuggerdotbreak.judahgabriel.com/2016/12/13/its-almo...

Re:I built a progressive web app and published it in three a... by inferiorhuman on Monday April 16, 2018 @12:11PM (#16850045)
> Some mobile platforms (read: iOS) are hostile to web apps.

I'm OK with that. Web apps are clunkier and provide a worse experience. That Google makes this easier speaks to the sort of UX you get with Android.

Re:I built a progressive web app and published it in three a... by scardine on Monday April 16, 2018 @12:22PM (#16850173)
> I'm OK with that. Web apps are clunkier and provide a worse experience. That Google makes this easier speaks to the sort of UX you get with Android.

Chicken and eggs argument here: web apps are clunkier and provide a worse experience because they are not well supported by the OS or the OS does not provide better support for web apps because they provide a worse experience?

Hybrid app frameworks exist because phone operational systems lack proper support for web applications.

Re:I built a progressive web app and published it in three a... by altfredd on Monday April 16, 2018 @01:48PM (#16851072)
> web apps are clunkier and provide a worse experience because they are not well supported by the OS

No, they are clunkier and provide a worse experience, because most "web apps" are ported version of desktop bloatware, targeting devices, permanently plugged into wall-mounted electric outlet.

What are "web applications" anyway? Something, that requires permanent internet connectivity? Something with DOM APIs? Something with built-in Javascript interpreter? Something with CSS support? The defining qualities of "web" have absolutely nothing to do with mobile devices. If anything, "web" has bad supported for OS. This is why all hybrid frameworks are about exposing additional OS functionality to browser, not the other way around.

Just accept, that you are looking at wrong tool for the job.

Re:I built a progressive web app and published it in three a... by scardine on Wednesday April 25, 2018 @05:32PM (#16926396)
I will not debate whether "web apps" are ported version of desktop bloatware but I don't see why you can't write offline-first, mobile-first progressive web applications using Javascript and HTML (except Apple's lack of enthusiasm supporting anything outside their walled garden)
Re:I built a progressive web app and published it in three a... by judah on Monday April 16, 2018 @12:15PM (#16850079)
I understand lock downs for security or user experience (e.g. disallow sites to auto-play video, etc). But restricting web apps to the point they're actually broken? No, that really sucks. Shame on Apple.

And if we care about freedom and the opened web, we should not cheer on proprietary, closed platforms like app stores. We should want the opened web to win.

Re:I built a progressive web app and published it in three a... by inferiorhuman on Monday April 16, 2018 @03:34PM (#16851994)
> I understand lock downs for security or user experience (e.g. disallow sites to auto-play video, etc). But restricting web apps to the point they're actually broken? No, that really sucks. Shame on Apple.

Shame on developers for cargo culting web apps over to various mobile platforms. Even on desktop platforms, non-native apps stick out like a sore thumb and generally work poorly (e.g. Slack). Granted I'm okay with my apps not doing autoplay video regardless of whether or not they're native.

> And if we care about freedom and the opened web, we should not cheer on proprietary, closed platforms like app stores. We should want the opened web to win.

How about the freedom to be rid of phishing apps and spyware? The "opened web" is not an all or nothing idea, and promoting web "apps" over proper native apps isn't a win.

Re:I built a progressive web app and published it in three a... by kop316 on Monday April 16, 2018 @12:22PM (#16850172)
I am not. That reinforces a iOS/Android ecosystem lock in. I personally want to see web apps succeed so it would be easier to move off of those platforms. If that happens, then I would foresee that web apps get first rate treatment and won't be "clunkier"
Re:I built a progressive web app and published it in three a... by inferiorhuman on Monday April 16, 2018 @03:38PM (#16852029)
Web apps got "first rate" treatment with the original iPhone. Remember how that worked out?
Re:I built a progressive web app and published it in three a... by thebouv on Monday April 16, 2018 @12:04PM (#16849965)
The reasons for this were listed in the actual article.

Can't play next song if it is in background, etc. All the tech reasons were listed out.

Re:I built a progressive web app and published it in three a... by yourapostasy on Monday April 16, 2018 @12:06PM (#16849986)
Along with technical reasons in original article, likely submitting as an app adds a marketing channel, and a big one at that, that wouldn't exist for a pure web app. Would be interested to hear from author if this is indeed the case, and if it was, if he feels the effort is worth the benefits.
Re:I built a progressive web app and published it in three a... by judah on Monday April 16, 2018 @12:09PM (#16850021)
Yep. Before being listed in the app store, I was getting about 5 new users sign-ups per day. Now I am getting about 15.
Re:I built a progressive web app and published it in three a... by Froyoh on Monday April 16, 2018 @12:18PM (#16850119)
There's a reason why is more difficult to publish an app onto the App Store