![]() I'm not sure whether if I can achieve Case 2. I have read documentations about background execution, multitasking, and local notifications of iphone APIs. I just wanna keep the connection alive for a longer period and when user comes back to the app, he found out that the connection will be still alive and be happy with that. No problem.Ĭase 2: if user pressed Home and app went to background, what could I do? I don't wan to show alert or something to interrupt user(he is away or playing games). I want to keep the connection alive for 120 minutes even if user does nothing.Ĭase 1: if app is in foreground, I can use timer to send some do-nothing data to server. ![]() server might send data to app while it does nothing.Īssume that if app does not send data to server for 30 minutes, server will close the connection.app (user) sends data to server and server responds data back."If your application is not an original voip application app storeĪn iPhone app, connecting to a remote server via TCP. Using this socket with uilocal notification you can get. If your application in background mode the voip socket will not close. If you turn on Keep-Alive, the HTTP response header will show Connection: keep-alive. htaccess or the main configuration file of your web server. To enable Keep-Alive, you need to explicitly request it via the HTTP header by accessing. Ģ.Add required background mode as "App provides Voice over IP services" in app.plist If the analysis tool shows that Keep-Alive is disabled, move to the next step. Solution 3ġ.Create your socket with VOIP property like this Please give us a note if this solved your problem. In Implementing a VoIP Application is a paragraph on Installing a Keep-Alive Handler. ![]() Minimum scheduling time is 10 minutes, though. The text after the quote refers to which allows you to set a block of code which allows you to keep alive a(your VoIP) connection. I am not sure if you're developing a VoIP app but you'll be able to access the sockets and react on incoming packets. This is no tested solution, but I think it can be used to achieve what you are asking for. Please have a look at Implementing a VoIP Application in Apple's iOS Application Programming Guide. Perhaps they'll introduce one in a future update to iOS, but you might consider submitting a feature request to voice your support for it. Unfortunately, though, there is no legal API to keep a connection alive in the background. Note that Apple frowns on using hacks like employing the background audio or VOIP APIs to keep non audio or VOIP apps running (as evidenced by the 'workaround' described in the article above) so dabbling with these techniques risks rejection at the point of submission. Tapbots solved this problem with Pastebot by prompting the user to run a silent background audio track at all times. ![]()
0 Comments
Leave a Reply. |