Example now stops and starts service publish and service discovery when

application is suspended (device sleeps) and becomes active (device wakes).
Important on iOS devices as device sleep kills browser and service
publisher.
This commit is contained in:
Jonathan Bagg
2017-10-09 21:30:17 -04:00
parent 8a9936a4a5
commit c130cb697d
3 changed files with 41 additions and 12 deletions

View File

@@ -107,4 +107,12 @@ qDebug() << zcs->txt["Qt"];
Qt5
On Linux, libavahi-client-dev and libavahi-common-dev
On Linux, libavahi-client-dev and libavahi-common-dev
### Apple App Store deployment
Publishing GPL software in the App Store is a [violation of the GPL](https://news.ycombinator.com/item?id=3488833). If you need to publish an app in the Apple App Store that uses QZeroConf, please contact me for a copy of QZeroConf with a BSD licence.
### iOS device sleep
When iOS puts the device to sleep, it breaks the DNS-SD browser and service publisher. The only way around this is to call stopServicePublish() and stopBrowser() when the application state changes to Qt::ApplicationSuspended (sleep) and then call start startPublish() and startBrowser() when the application state changes to Qt::ApplicationActive (wake). See appStateChanged() in example.