I'm developing a calling app. I use FreeSwitch as the VoIP server and Linphone as the VoIP library. I want the app to be able to receive a call while it's not running. Battery optimization always kills it off. I wonder how app like the Facebook messenger or Google Duo can do it.
The app aims to enable the user to call without an Internet connection so I'd prefer a solution that requires no internet. However, I'd also appreciate any kind of other solution. I can always remove the offline capability feature.
If it'd be useful at all, I used Firebase as the backend including the server.
Right now I'm using a foreground service as a way to keep the app awake but it consumed too much battery and it's only last around 32 hours.