2

I am developing chat app that need to keep socket connection open while app is not active. I have tried by modifying app background setting to VOIP, still OS kill my app after 10 min. approx.

I have already developed same chat app in titanium ios. Titanium provides Ti.App.backgroundservice for background purpose. It runs infinity on it. I have also checked titanium's class files for background services they provide, but it is difficult to understand.

My question is how titanium make it possible to run background service infinitely? So that I can use same methods to keep my socket connection alive infinitely in my core ios app.

Ashish P.
  • 848
  • 5
  • 12
  • 1
    According to doc http://docs.appcelerator.com/titanium/latest/#!/api/Titanium.App.iOS.BackgroundService even Ti can't run infinitely. They maybe have some resuming mechanisms. There is a hack for that - you can play silence sound all the time when registered as VOIP or audio player. But this won't pass app store review. Have never tried that. Have you thought of using NS*Stream instead of pure sockets? – Maciej Oczko Oct 24 '13 at 06:05
  • Actually, my titanium ios app it accepted by apple review team. So, I think there won't be any issue if I use hack like titanium. I will try using NSStream as suggested by you and let you know it it works. – Ashish P. Oct 24 '13 at 06:14

1 Answers1

1

I don't have experience of titanium so can't say how it works in it, but check below comment for iOS,

Please check iOS Voip Socket will not run in background, in iOS for VOIP app you will need TCP socket who's property is set to VOIP.

Are you getting 0x8badf00d exception when application is killed?

Community
  • 1
  • 1
Vishwa Patel
  • 484
  • 2
  • 10