how to activate a background app to service a TCP/IP stream with another nearby device?

StackOverflow https://stackoverflow.com/questions/16020073

  •  04-04-2022
  •  | 
  •  

Question

I have two devices, a 'manager' iphone and a 'worker' iphone, nearby each other.

A 'worker' app on one iPhone needs to respond to a request for data from a 'manager' app on another nearby iPhone, by Bluetooth or WIFI.

The worker app publishes itself as a Bonjour service.

The manager app on the 2nd iPhone finds worker app service by Bonjour, and tries to establsh a TCP/IP data connection.

But if the worker app is in background mode, how can it be awakened to begin servicing the TCP/IP stream with the remote manager app?

(I'm a Bonjour newbie, but an iPhone streaming oldbie.)

Était-ce utile?

Autres conseils

Apple don't provide a background mode for generic servers, so if you want to publish to the App Store and your app doesn't fit one of the other background modes, you're out of luck. If you don't have to go through the App Store, then you can use one of several hacks to make your application run in the background, such as abusing the VOIP or media player background modes.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top