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
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
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.