1
votes

I'm doing a VOIP project on iPhone. I have the problem to keep the socket alive. I already configured one socket for VOIP usage, and set kCFStreamNetworkServiceTypeVoIP for CFReadStreamRef and CFWriteStreamRef.

  • When my app runs in the foreground and I don't do any action, after 1 minute iPhone will sleep, black screen. My socket is still connected to the server.
  • But when my app runs in the foreground I press home button, and don't do any action, about 1 minute iPhone will sleep, then my socket disconnects from server.

Please help me.

1

1 Answers

1
votes

First, have you read Tips for Developing a VoIP App? From your description, it sounds like you haven't set UIBackgroundModes to voip. You also likely will need to configure a keep alive handler.