7

I'd like the app to advertise a service even when the app enters the background. With Core Bluetooth, this is possible by setting bluetooth-peripheral for UIBackgroundModes.

Does anyone know if the same can be achieved with MCNearbyServiceAdvertiser? Thanks.

kenshin03
  • 103
  • 1
  • 9

1 Answers1

7

When I was at WWDC this year I went to a Developer Lab for Multipeer Connectivity and was told by an Apple engineer that no, service advertisers and browsers will not work in the background.

That said, I've been successfully communicating with connected peers with an app running in the background using a background task, but I have not been able to advertise or browse.

ChrisH
  • 4,468
  • 2
  • 33
  • 42
  • Thanks that's very useful to know. I'll be doing some testing to try to make this work as well. – kenshin03 Dec 11 '13 at 17:44
  • Were you able to maintain the peer connection alive for a long time using background tasks? – Pascal Bourque Jan 21 '14 at 18:35
  • I'm curious about this too. How can I maintain that connection so that my chat app can still receive notifications from others in the chat room? – Sebastian Dwornik Apr 23 '14 at 14:11
  • Can you please share some sample code... that how you are maintaining connection in background and how you are receiving/sending messages... – Anshul Jul 07 '14 at 10:45
  • Did you find anything out about that? I'm trying to do something similar, but don't know how to connect to a device that's having the app running in background – gasparuff Aug 26 '14 at 17:12