0

I am developing iOS app, that fully needs internet connectivity to run. So every time it needs to check the internet connectivity of the device. Kindly help me to solve this problem with some simple solution. Thanks in advance...

rmaddy
  • 298,130
  • 40
  • 468
  • 517
iBeginner
  • 249
  • 4
  • 12
  • 2
    Please do some research before asking such a common question. – rmaddy Jul 16 '14 at 04:33
  • http://stackoverflow.com/a/3597085/3411191 – Zane Helton Jul 16 '14 at 04:35
  • @rmaddy I surf a lot but I can't find any simple solution thats why I asked. And I am very new to iOS. – iBeginner Jul 16 '14 at 04:35
  • Here's a tip when working with distributed and or networked systems - just because a service is reachable when you check, doesn't mean it will still be reachable when you're actually using it. – Carl Veazey Jul 16 '14 at 04:36
  • @rmaddy I am using xcode 4.5 but the sample code is for xcode 5 and above. Kindly give some suggestions. Thank you.. – iBeginner Jul 16 '14 at 05:33
  • Use Xcode 5. You have to if you plan to send your app to Apple. – rmaddy Jul 16 '14 at 05:38
  • @rmaddy If I develop this app in Xcode 4.5 means Apple Doesn't accept my app? – iBeginner Jul 16 '14 at 05:46
  • That is correct. You must use Xcode 5, you must fully support iOS 7, and you must fully support 4" screens, and you must fully support retina displays. Failure to do any of these and Apple won't accept your app. – rmaddy Jul 16 '14 at 05:58

1 Answers1

0

Apple's Reachability will help you do that.

The Reachability sample application demonstrates how to use the SystemConfiguration framework to monitor the network state of an iOS device. In particular, it demonstrates how to know when IP can be routed and when traffic will be routed through a Wireless Wide Area Network (WWAN) interface such as EDGE or 3G.

https://developer.apple.com/library/IOS/samplecode/Reachability/Introduction/Intro.html

YogevSitton
  • 9,578
  • 10
  • 55
  • 90
  • 1
    How did you submit this after I closed the question? Strange. – rmaddy Jul 16 '14 at 04:35
  • 1
    We probably both submitted at the same time :) – YogevSitton Jul 16 '14 at 04:37
  • 1
    I closed the question 15 seconds before you posted your answer. Must be a bug. BTW - I didn't down vote you. – rmaddy Jul 16 '14 at 04:38
  • It [happens occasionally](http://meta.stackoverflow.com/questions/252711/this-answer-was-posted-after-the-question-was-closed-how-is-that-possible?lq=1), @rmaddy; it's more of a networking issue than a flat-out bug. – jscs Jul 16 '14 at 04:41