0

We are working on conference related application, Is it possible to send and receive packets through socket, after the application entered background? I have googled and found some way like below....

eg: 

UIApplication *uiApplication = [UIApplication sharedApplication];

backGroundTask = [uiApplication beginBackgroundTaskWithExpirationHandler:^{
    CFRunLoopRun();
  }];

What CFRunLoopRun is doing here. If it will work.. How? I am not clear. Help me where to go from here...

thanx.

Newbee
  • 3,231
  • 7
  • 42
  • 74
  • 1
    This will only be possible in either case A) You need it for less than 10 minutes or case B) Your app is setup as a VOIP application, and approved by Apple for this. I have no idea what CFRunLoopRun is doing there, it looks like someone's attempt at some kind of hack. Don't use it. – borrrden Sep 03 '13 at 06:24
  • @borrrden thank you for your reply... I will think of the possibilities you mentioned, can you please tell me what exactly CFRunLoopRun() will do.. I checked documentation.. still not clear.. – Newbee Sep 03 '13 at 06:29
  • 1
    It will start a thread's run loop, which waits for inputs like timers and touch events. Someone thought they could be clever and force the system to keep running in the background here but this is likely just going to get the application killed by the OS. – borrrden Sep 03 '13 at 06:31
  • Ya got it.. Thanks... If you can please post it as answer, so I can accept. :) – Newbee Sep 03 '13 at 06:34

1 Answers1

0

It will start a thread's run loop, which waits for inputs like timers and touch events. Someone thought they could be clever and force the system to keep running in the background here but this is likely just going to get the application killed by the OS. – borrrden

Newbee
  • 3,231
  • 7
  • 42
  • 74