Hello, all!
We already have an app in ionic 3 and would like to scale it to also become a descent webpage. So right now we’re researching the possibilities and all the tricky parts. It would sure require a lot of changes, but we’re ready to almost completely rebuild our app in terms of looks and navigation.
Just wanted to know if anyone already had experience using one codebase for all 3 platforms (android, ios and browser)? How would cordova plugins behave in this situation? Are there nice open-source examples?
No experience with PWAs myself, but as far as I know Cordova and so the plugins just won’t be available. But looking at you list, everything but the barcodescanner shouldn’t be too hard to replace.
I can share some of my findings here. If we build ionic app with ionic cli it will automatically add the PWA functionality to our app. All we have to do is edit manifest.json and uncomment some of the code in index.htm to enable Service Worker which is also already set up for “first network then cache” strategy. I spent a lot of time on googling and this link is the best starting point for understanding Service Workers (lots of links inside, seriously - it’s an endless rabbit hole): https://aarontgrogg.com/blog/2015/07/20/the-difference-between-service-workers-web-workers-and-websockets/
In ionic service workers are implemented via sw-toolbox, so here’s lots of handy information:
We haven’t decided how to handle cordova plugins still, so I guess it’s gonna take more time for research. One of the ideas was to move all of them into services and to use alternative services for browser.
Any additional information or questions are very welcome