I am not sure if this is possible, but I have this scenario.
I have a website displayed in my UIWebView which has the link set in a UISegmentedController. They website can detect if you are on wifi or on the 3g network.
Now the segmented controller points to 2 different pages: 1 - An iPhone friendly login screen 2 - The home page, once you are logged in.
Now here is the question:
Can I program my application to detect whether it is to WIFI or 3G (I know you can do this), but then based on the answer go to segment 1 or 2
Kind of like this:
if (iPhone device is on 3g) { Go to Segment 1; } else { Go to Segment 0; }
Look for the WiFi symbol in the upper left of the screen. Turn off cellular data. If you are able to connect to the Internet then you are using WiFi (unless you are tethered to a hotspot by Bluetooth or USB). Also you will see the WiFi symbol at the top of the screen.
If a setting is off, iPhone uses only Wi-Fi for that service. Note: Wi-Fi Assist is on by default. If Wi-Fi connectivity is poor, Wi-Fi Assist automatically switches to cellular data to boost the signal.
An iPhone will automatically switch from the cellular connection when it successfully makes a Wi-Fi connection. Likewise, it will go back to cellular connectivity if the user turns Wi-Fi off or the connection drops.
Go to Settings → General → Cellular → Enable 3G: ON. If #1 is OK, try switching ON the "Airplane Mode" for about 10 seconds and then turn it back OFF. Go to Settings → Airplane Mode: ON, wait 10 seconds and turn OFF. If #2 doesn't work, reset the network settings.
Using the code that Apple has provided here
Reachability *reachability = [Reachability reachabilityForInternetConnection]; [reachability startNotifier]; NetworkStatus status = [reachability currentReachabilityStatus]; if(status == NotReachable) { //No internet } else if (status == ReachableViaWiFi) { //WiFi } else if (status == ReachableViaWWAN) { //3G }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With