Re: iOS; how to "connect" to 3G
Re: iOS; how to "connect" to 3G
- Subject: Re: iOS; how to "connect" to 3G
- From: David Duncan <email@hidden>
- Date: Thu, 18 Oct 2012 13:12:31 -0700
On Oct 18, 2012, at 12:55 PM, M Pulis <email@hidden> wrote:
> My iOS app uses the Reachability sample code to detect network availability to work "offline" or "online".
>
> When using 3G, we get to the "connectionrequired" state. What to do then? We try a login to our web site and that fails.
>
> WIFI works great, but we need 3G also.
>
> What am I missing or should read up on?
If you use CF or NS (or anything build on top of that) to connect, then it should "just work". If you are using raw BSD sockets, then there is no way to connect other than using CF or NS.
Also Reachability isn't meant to be used to determine online vs offline. Its meant to determine if it is a good time to try to connect or not. Due to realities of networking it is entirely possible for Reachability to tell you "try to connect" and to fail completely.
Basically when using Reachability, you should always use the callback to know when to retry any previously failed connections, and once you get a callback that says that connection is possible, then you should try to make the connection, while continuing plan for possible failure.
--
David Duncan
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden