3
votes

I am trying to implement an iOS VOIP application.

I am using GCDAsyncSocket to listen on a port for connections. I did add the required background modes in info.plist and also registered the readstream and writestream to kcfNetworkServiceTypeVOIP.

I also added KeepAliveTimeOutHandler to wake up the app. The handler block just prints the wake up time to stdout.

As long as app is in foreground new connections are accepted but when the app is in background, the app is not waken and all the connections attempted are sent to the socket when the app moves to foreground again.

I searched through many solutions but could not get it to work.

Thanks in advance.

1
Maybe because apple just store connected socket for you, so message through these sockets can arrive but new socket can't be established. I have seen someone else also have such problems.dustdn
i also met this issue, i read below blog but no help: raywenderlich.com/29948/backgrounding-for-ioszolibra

1 Answers

0
votes

I am not sure if it is still relevant for you but in case someone else reads this question. As discussed in other similar question on stackoverflow in this one for example you can have only one socket which is in NetworkServiceTypeVOIP mode. Otherwise both of them will not work and your app will not wake up and not accept new connections.