2

I have a simple UDP client program bound to a port which takes CallerID information from a UDP broadcast that is sent by hardware purchased by the app's user. While the application is in the foregound everything works fine, but when the application is in the background the UDP packets are held (not captured and handled - the application takes data from the UDP packet and HTTP POST it to a server defined by the application's user), anyway these UDP packets are held (not sent to server) until the app is brought back out of the background and put in the forground.

I want the application to listen in on the port, capture packet (capture CallerID), and then send data to the server(a server that the USER defined) via HTTP POST to their own server's web application, all while in the background.

HOW can I do this?

Thanks in advance.

Sam
  • 43
  • 1
  • 6
  • Why don't you write to ask Apple support why they don't allow your app secretly capture network data in the background from specific ports and post it to your server? Maybe they can give you an answer. –  Sep 08 '17 at 20:40
  • Sorry, you misunderstood me. Please see edits. – Sam Sep 08 '17 at 20:59
  • 1
    Have you tried opening up the listening on a background task? I think they will only even allow those to run max 30 seconds but its worth a try. – NSGangster Sep 08 '17 at 22:35
  • Even if you are speaking about background ... if you put your device in standby you will never receive udp messages (explained in some Apple documents) but you can receive tcp connection requests. I think probably is the same for the application in background. – Lorenzo Sep 09 '17 at 10:30
  • https://stackoverflow.com/questions/24280061/keep-alive-udp-socket-in-background-for-ios – Lorenzo Sep 09 '17 at 10:31
  • I find this : https://forums.developer.apple.com/message/122201#122201 – Lorenzo Sep 09 '17 at 10:38

0 Answers0