I currently have the requirement for a new app which shall work as website but also have a mobile android and iOS app.
I thought this could be a perfect use case for Ionic using PWA for website and building the apps, but after some research I somehow have doubts that this will work well with the same codebase.
I don’t need much native functionalities on the mobiles, the only thing would be PUSH notifications.
Could you tell me please if this is an expected use case to go for both - native AND pwa in one codebase?
And if yes:
I need some tracking in the app so I wanted to include Firebase analytics as I have experience in another ionic app with that, but how can I do this then on the website part? Does anybody know how this is usually solved?
The perfect use case for PWA and Native is using Capacitor
But…Capacitor handle push notifications but I don’t know the current status if that include web push notifications or not
Regarding analytics, I think it’s not yet included
That being said, I generally solve that use case, having a unique code base, like the following: I create wrapper service, where I handle web or native. So I create an environment variable and according its value, I gonna do that or that
Concretely, for Google Analytics for example, if its native I’ll use the cordova google analytics plugin, but if its the web, then I’ll use the Google Analytics JS lib
Thanks for your response.
Yes the wrapper with platform switch was also something I was thinking about.
Unfortunately according Capacitors website the push feature is not including PWAs yet…
I guess it’s a matter of time, someone should provide a PR one of these days…
About that, for a client I had to implement Web Push with Firebase this week, works great on Android, just followed the Google. On the other side, still not implemented on iOS.