Creating native app using background services and notifications

Hi, has anyone created a mobile app sending location via url call from a background service. I also need to support a notification service like firebase or one signal. Any thoughts? Thanks

I have. You now have to get the users permission to capture location data and they have 3 options: No, not ever; only when using; sure, go ahead and track me. The geolocation plug-in documents this. Beyond that, to capture geolocation in the background you need a background task and those are incredibly difficult to do in Cordova.

Push notifications are easy. I use firebase and a pretty popular plug-in. The problem begins when you try to debug it as there are a lot of moving pieces. Once you get it going, it’s solid.

If the notification route is difficult for your design and you want/need either the client or host to send a message on-demand, when the device is connected to the internet, you might want to look at WebSockets. There’s an example in Appstudio.

It’s just like an open socket between you and the server. You can run them as WS or WSS, eg, not encrypted vs encrypted.

WSS-encrypted WebSockets work in the PWA environment. Unencrypted WebSockets, like any unencrypted resource, can cause CORS errors.

Thank you for that. I’ll check it out.