Reachability issue on iPhone: networkStatusForFlags
Asked Answered
C

2

9

I'm doing a few server calls and getting back some json. The code is pretty simple, it does a call to sign you in, and then does another call to get more info. I keep getting Reachability errors when I try to make the second call.

Reachability Flag Status: -R ------- networkStatusForFlags

Not sure why it does that. I'm running this in the simulator and I'm on Wifi and the first call goes through just fine.

Chandlery answered 16/2, 2012 at 11:34 Comment(0)
G
8

If you're using the Reachability sample code from Apple, that is not an error but a debug message. In particular, the R flag means that the network is reachable (yay!).

The sample code prints reachability flags by default. You can turn off this behavior by setting kShouldPrintReachabilityFlags to 0 in Reachability.m:

#define kShouldPrintReachabilityFlags 0
Guttle answered 27/11, 2012 at 1:23 Comment(0)
A
0

you can download the "Reachability" classes from the following URL and you can get the wifi and internet flag checking.

https://developer.apple.com/library/ios/#samplecode/Reachability/Introduction/Intro.html#//apple_ref/doc/uid/DTS40007324

So, while requesting the API, you need to get the current status of internet connectivity of your device and if you are connected with that, request the API.

I think this may useful for you.

Alva answered 22/6, 2012 at 6:28 Comment(1)
I suspect the OP is already using the Reachibility sample code.Guttle

© 2022 - 2024 — McMap. All rights reserved.