Making a PWA with literally 1 line of code

in #news4 years ago

Right before 2020 turned into a global shitshow, I gathered a couple of friends and together we came up with an idea for a simple little app we thought would be helpful. Humbly called The Coronavirus App, our app ended up being used by more than 15 million people, making it — I believe — one of the most widely used PWAs ever.

I love the web. And I love PWAs. What’s not to love, really? With a PWA, you only have one code base to manage. Your app works everywhere. And you don’t have to share 30% of your hard-earned revenue with Apple and Google.

But there’s something really strange about PWAs. It’s at the same time ridiculously easy to get started and incredibly painful to go all the way.
The PWA Dichotomy

Create a JSON file, call it manifest.json, fill out the fields recommended by Google. Then create a JavaScript file, call it service-worker.js, register it from your client-side code. You’re done. You have a PWA that kinda words. It took you a couple of hours to figure everything out, and 30 minutes to actually write the code. Not bad.

From here, things go downhill.

Let’s say you want to add a button in your code that lets users install your app on their device. For reference, below is how Google suggests doing it.

Feels kind of hacky. But easy enough.

Except when you’ve done that, you’ve done about 2% of the work.

On Windows/Chrome, the beforeinstallprompt will also sometimes be emitted several times per session. And sometimes after the app has been installed. Meaning that by relying on that event, you could ask users to install the app… after they’ve installed it. On iOS/Safari, it never gets triggered at all. So you never even get an opportunity to tell your users your app is installable.

And even on Chrome — when beforeinstallprompt is fired, it means the app is installable. But what does it mean when it… doesn’t get fired? Does it mean the app can’t be installed? Or that the app is already installed? And what am I supposed to do with my install button while I wait for the beforeinstallprompt to fire or not fire?

Or we could also talk about the appinstalled event. It would be really useful if it wasn’t for the fact that this event is never triggered at all on iOS/Safari or Android/Samsung Internet. After the app is installed, you’ll likely want to hide or disable the install button. How do you do that when you’re not even sure the app was installed in the first place?

http://rwandaartsinitiative.com/community/profile/free-watch-2020-mookuthi-amman-online/
http://rwandaartsinitiative.com/community/profile/free-watch-2020-ammonite-online/
http://rwandaartsinitiative.com/community/profile/free-watch-2019-spider-man-far-from-home-online/
http://rwandaartsinitiative.com/community/profile/free-watch-2020-vanguard-online/
http://rwandaartsinitiative.com/community/profile/free-watch-2020-greenland-online/
http://rwandaartsinitiative.com/community/profile/jingle-jangle-a-christmas-journey-full-movie/
http://rwandaartsinitiative.com/community/profile/soorarai-pottru-full-movie/
http://rwandaartsinitiative.com/community/profile/free-watch-2020-run-online/
http://rwandaartsinitiative.com/community/profile/free-watch-archive-2020-online/

https://www.guest-articles.com/others/voici-la-nouvelle-attestation-drogatoire-de-sortie-valable-ds-maintenant-28-11-2020
https://selifid679.medium.com/making-a-pwa-with-literally-1-line-of-code-53cb90d344ca
https://www.peeranswer.com/question/5fc1cf07f01be20312b78878
https://onlinegdb.com/HkJA_U1iv
https://paiza.io/projects/YEeCLy9gvevKM3Hqw35AAg
https://jsfiddle.net/hy6m1e2b/
https://friendpaste.com/1AcVU6NbLoiKJGVcfXUPoY
https://notes.io/MKsA
http://www.onfeetnation.com/profiles/blogs/sadfgsdagfasg
https://molen86.hatenablog.com/entry/2020/11/28/133219?_ga=2.11176956.99615197.1606537943-579796112.1606537943
https://blog.goo.ne.jp/dfsfgyyyu/e/9433487629eee519a94404b5684d8bb7
http://officialguccimane.ning.com/photo/albums/asgfasf
https://www.topfind88.com/post/917056/watch-mookuthi-amman-2020-online-free-fullmovies123-%E2%80%93-profile-%E2%80%93-rwanda-arts-initiative-forum
https://www.posts123.com/dashboard.aspx
http://www.raptorfind.com/link/835116/watch-mookuthi-amman-2020-online-free-fullmovies123-%e2%80%93-profile-%e2%80%93-rwanda-arts-initiative-forum
http://facebookhitlist.com/forum/topics/dsgsdgdsg-1
https://caribbeanfever.com/photo/albums/sdsadasd
https://dcm.shivtr.com/forum_threads/3273863?post=14458738#forum_post_14458738
http://recampus.ning.com/profiles/blogs/sadfgsdagfasg
https://www.mydigoo.com/forums-topicdetail-201960.html
https://thesanguy.com/forum-mobile/topic/call-girls-escort-service-in-delhi/?part=2#postid-288054
https://note.com/sdsdqw/n/na2f509db5d0b
https://www.hybrid-analysis.com/sample/12c78a6c7df1756a3db86782a7805aedd0c8a0a44b8c1441200d0eaf72d2fddc

Coin Marketplace

STEEM 0.19
TRX 0.13
JST 0.030
BTC 63749.66
ETH 3419.02
USDT 1.00
SBD 2.48