I\'m using Reachability successfully to determine the status of the network, and to be notified of changes (e.g. Reachability Guide for iOS 4).
My question isn\'t h
By default in the background state app stays for a short time only, most apps move to the suspended state shortly afterward. That mean the app is in the background but is not executing code. So your custom implemented notification do not work. Must requery NetworkReachability at Wakeup Time in app delegate methodes:
applicationWillEnterForeground:
applicationDidBecomeActive
I was working on a VoIP app, which is launched in the background when the iPhone boots up, at which point there might be no network reachability (e.g. if the phone has both a passcode and/or a SIM card with a PIN code). But since the app is launched directly in the background, the delegate method applicationDidEnterBackground:
is not called. Instead what I did was use @Hurden's idea directly in application:didFinishLaunchingWithOptions
, checking the applicationState
to see if the app was actually starting in the background. This enabled my app to get the kReachabilityChangedNotification
notification after the phone was unlocked (enabling the WiFi to connect using the stored password).