Live data from Hacker News

Ask HN: How are you building cross-platform (mobile and browser) apps?

news.ycombinator.com

1–10 of 84 posts

Ask HN: How are you building cross-platform (mobile and browser) apps?

#1
I've been developing web apps for 5+ years and in my next project I've been tasked with building a mobile (iOS and Android) app that we can also run as a web app. I would obviously like to try keep a single code base for simplicity as we have limited resources. I've investigated writing a PWA but I'm put off by the arbritrary heuristics that Google are placing on whether or not the apps are presented as "installable".

After that, it seems the only options are Ionic, or React Native + separate web app.

What is your experience writing apps for both mobile and browser?

Re: Ask HN: How are you building cross-platform (mobile and browser) apps?

#2
We launched https://usebx.com as a PWA, and have successfully managed to keep a single code base across pretty much all devices. The install process isn't much of a problem either, as a user can always "install" your app by adding it to the home screen. I would definitely recommend a PWA, unless you need some hard core native features that aren't available in browsers yet.

Re: Ask HN: How are you building cross-platform (mobile and browser) apps?

#3
post #2

We launched https://usebx.com as a PWA, and have successfully managed to keep a single code base across pretty much all devices. The install process isn't much of a problem either, as a user can always "install" your app by adding it to the home screen. I would definitely recommend a PWA, unless you need some hard core native features that aren't available in browsers yet.

Do you have any requirements for offline data storage for your PWA? If yes, how do you manage it? From what I've heard the amount of space available for data varies wildly between devices. In that case what does your offline data storage strategy look like?

Re: Ask HN: How are you building cross-platform (mobile and browser) apps?

#5
post #3
post #2

We launched https://usebx.com as a PWA, and have successfully managed to keep a single code base across pretty much all devices. The install process isn't much of a problem either, as a user can always "install" your app by adding it to the home screen. I would definitely recommend a PWA, unless you need some hard core native features that aren't available in browsers yet.

Do you have any requirements for offline data storage for your PWA? If yes, how do you manage it? From what I've heard the amount of space available for data varies wildly between devices. In that case what does your offline data storage strategy look like?

We use indexeddb, which is generally okay, but you're right, the DB size can vary across browsers (I think some limit to 10mb, and others to half the HDD). For our use case, it was good enough. Our strategy is to try and cache things offline, but if indexeddb fails to store the data, we attempt to fetch from the server. As the saying goes, cache invalidation is hard, but that's true regardless of the platform.

Re: Ask HN: How are you building cross-platform (mobile and browser) apps?

#7
Depending on your needs, using something like Turbolinks [1] may be a great fit. There are iOS and Android libraries that can make your web app talk to your native app so it can do things like trigger screen transitions, populate native menu or tab controls, etc. We're using a similar idea at my company and so far it's been very successful for us.

[1]: https://github.com/turbolinks/turbolinks/#readme

Post reply on HN