How to get Reachability Notifications in iOS in Background when dropping Wi-Fi network?

后端 未结 2 1518
南笙
南笙 2020-12-23 17:28

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

2条回答
  •  -上瘾入骨i
    2020-12-23 17:52

    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 
    

提交回复
热议问题