SCNetworkReachabilityGetFlags returns 0 even when wireless available

后端 未结 4 1675
花落未央
花落未央 2020-12-17 03:21

I have an app that uses Apples reachability code. When I tab out of the app, turn on airplane mode, go back into the app, I correctly get a message that says no connection i

4条回答
  •  情话喂你
    2020-12-17 03:56

    If the flags were received and they end up being 0, as you've seen, this indicates Airplane Mode is on. However, the results of this check seem to be cached, at least for a short time. Try this: leave your app, turn Airplane Mode off, hit a site in Mobile Safari, then return to your app. This may invalidate the cache.

提交回复
热议问题