问题描述
即使应用进入后台,我也希望该应用宣传服务。使用Core Bluetooth,可以通过为UIBackgroundModes设置bluetooth-peripheral来实现。
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.
有没有人知道MCNearbyServiceAdvertiser是否可以实现相同的目标?谢谢。
Does anyone know if the same can be achieved with MCNearbyServiceAdvertiser? Thanks.
推荐答案
今年我去WWDC时,我去了一个开发人员实验室进行Multipeer Connectivity,并被Apple工程师告知不,服务广告商和浏览器将无法在后台运行。
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.
这篇关于应用程序进入后台时startAdvertisingPeer是否有效?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!