简体   繁体   中英

iPhone Bonjour From Background

I'm developing an iPhone app that uses Bonjour Services, and I have the following question:

When the app is sent to background, I need to close my Bonjour service; when the app comes to foreground, how do I restart my Bonjour service?

Thanks

You should be able to make use of the UIApplicationDelegate methods. Specifically, I would take a look at applicationDidBecomeActive: and applicationDidEnterBackground: . When it becomes active, start Bonjour; when it enters background, stop it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM