I think that I have all the requirements to have a live socket when the application is in the background. I.e:
- My app has voip and audio as background modes.
- I use PJSIP as a SIP library, which should use CFReadStreams with the "Run in background" property enabled
- The application uses TCP to establish a connection to the SIP server.
When an application is sent to the background, it adds a background handler that sends a “keepAlive” message every time period.
This keepAlive seems to work. If I check the logs on the server, I can see how the messages arrive, even if the application is not in the foreground.
The problem (and question) is that I do not receive calls when the application is in the background.
It seems that the socket is still alive, if I make a cell phone call, and the application is not in the foreground, nothing happens, but if I launch the application myself, the call will be automatically detected.
Thanks:)
source share