Search code examples
iphoneiosbonjour

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


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.)


Solution

  • I am using Apple's Core bluetooth (Bluetooth Low Energy - BTLE) because it works in the background.

    https://developer.apple.com/library/ios/documentation/CoreBluetooth/Reference/CoreBluetooth_Framework/_index.html#//apple_ref/doc/uid/TP40011295 See Apple core bluetooth framework reference