Data on the iPhone? - ios

I am developing an app that requires the user to be able to request a server and get back some JSON Data. Here are my question and my reasoning behind it:
1) Would this require the user to have "Data" on their cell phone plan?
Dealing with Android, I have figured out that when I do not have "Data" on my cellphone plan, that I can not access the internet, but I am allowed to use twitter. Instagram, however does not load when I do not have "Data".
When I do have Data on my cellphone plan, I am allowed to go onto the internet, use twitter, and use Instagram.
Will my App act as twitter or Instagram in this case? and how do I make the app work without a Data plan?

If your app needs to access the Internet (which is does to reach the server) then the user must either be connected via WiFi or if connected via cellular, the user must have a data plan.
A cellular connection with no data plan will prevent your app from accessing the Internet.

You need to have some sort of connection to the Internet to be able to access the internet.
You don't need a data plan, if your device is connected over wifi (such as iPod touches) then that will allow a connection to the internet.
The apps you mention do run on a device without an internet connection because they handle the case where there is not an internet connection sensibly, and although they load, they don't crash because of a lack of connection.
If you want to do the same thing, then you need to have a way of handling this too.

Related

How to have a FlashAir Access Point over WiFi while still reach out internet via Cellular Data on an iOS app that uses AFNetworking?

IMPORTANT: I don’t need simultaneous transfers, I mean, I don’t need to transfer over WiFi while still transferring over 4G at the same time, I just want to be connected over Wifi to my Access Point, transfer some files and finally not having to turn off the WiFi for the iPhone to use 4G.
The problem:
As long as I’m connected to the Access Point (FlashAir technology), my iPhone doesn’t care to use 4G to reach out for internet, it is like it says: Oh, I have a WiFi connection I’ll direct all HTTP GET Requests over this network, which is bad for me as this Access Point is used to read/write files from/to it.
What I’ve done so far without success is the following two things:
Add the nogatewaymode=1 variable to the conf file of my FlashAir device which makes the iOS platform to know that this Access Point is not intended to provide internet, so, when I connect via WiFi to the FlashAir, the iPhone uses 4G to reach internet, which is cool, the problem here is that in this mode I cannot read/write files to the FlashAir device, which makes a useless WiFi connection.
Configure the FlashAir device to Internet Pass-Thru mode which allows it to behave as an Access Point and as Router basically, this requieres to add an APPMODE=6 to the conf file and also add a couple of variables to give a secondary or parent network (SSID and Pass). This actually works, but on a WiFi only scenario, I don’t have to switch between WiFi connections to get files from the Access Point and then upload them using internet as in the latter it just uses its secondary network to reach internet. The problem is that if we are away from the secondary network, you get the Access Point functionality but when trying to get internet the iPhone only cares to try to reach the internet over this WiFi connection which is not possible because we are away from the secondary network, and it just reports a No Internet Connection error, it doesn't even try to use 4G which is there ON all the time.
Some additional information is that I’m supporting iOS 8+, I’m using Obj-C for this project and I’m using AFNetworking to perform requests to either internet web services and the FlashAir device as is supports it, it has a built-in web server which listens for HTTP GET requests (cgi) with parameters.
Any ideas?
Thanks in advance
My app requires that the Flashair deliver a webpage to the phone using Wifi. That page requires internet (4G) to upload data from the Flashair to my site.
Flashair claimed it wasn't possible, this config works for me. That "NOGATEWAYMODE=1" is critical. And I have to access the Flashair via the browser using 192.168.0.1, you can't use the Netbios/Bonjour name.
[Vendor]
CIPATH=/SD_WLAN/WifiStatus.jpg
APPMODE=4
APPNETWORKKEY=********
VERSION=FA9CAW3AW3.00.01
CID=02544d535731364740d36e0a79010b01
PRODUCT=FlashAir
VENDOR=TOSHIBA
MASTERCODE=A1234567890Z
APPSSID=F751ENG4
APPNAME=F751ENG4
LOCK=1
WEBDAV=2
TIMEZONE=-28
DNSMODE=1
APPAUTOTIME=0
REDIRECT=1
NOGATEWAYMODE=1

Detect a captive portal on iOS

So I'm able to detect whether or not the user has basic internet connection fine using Apple's reachability class. However, when I try to detect whether or not they are connected to a Wi-Fi network that utilizes a captive portal, I get back NetworkStatusReachableViaWiFi, which makes sense. However, this will also be returned if the user is simply using a WiFi connection.
I need to be able to detect both no internet connection and the captive portal situation, as that is effectively no internet.
Are there any reliable API's that can accomplish this task? Based off this article, http://blog.erratasec.com/2010/09/apples-secret-wispr-request.html#.VxkmrJMrIy5, Apple pings an internal address when you connect to WiFi to check for a captive portal. I'd prefer to avoid pinging any outside networks, however if I must, does anyone know how I could ping the same Apple address and use the response to tell if my user has a captive portal up?
Edit: I've come across NSURLConnectionDelegate and its method connection:willSendRequestForAuthenticationChallenge:. I think this method may be able to do what I need, I can send a basic request to www.google.com and make myself the delegate, and if this method gets hit do what I need to do. I think I would then be able to call cancelAuthenticanChallenge:
Has anyone ever used this method before to detect a captive portal? How did it work?

Can you communicate with nearby devices using a website?

Can a website help a user communicate with nearby devices via bluetooth/WLAN without downloading software?
User requests that something be done on their device (which could be, for example a wirelessly connected printer or a bluetooth keyboard).
The site, which contains a repository of relevant actions, sends specific instructions for that device to the user's own machine.
Those instructions are then relayed to the correct device (with the user's permission) via the user's device's WLAN or existing bluetooth connection.
Part 3 is what I'm not sure of - is there a mechanism by which a website can contribute to a wireless/bluetooth connection held locally?
It is not possible. User browser can't interact with hardware for wireless networking.
You should force user to install some custom software to do this.
You would have to submit the "commands" first, then have the device make requests to the website server, i.e., check for any pending "commands" for the device, and then process them locally. A website is not "thing" that can directly interface with a hardware device.

Is mesh networking possible through Safari on iOS?

Since iOS 7 was released, it's possible to connect devices through a mesh network using the Multipeer Connectivity Framework that can be used for app development.
My question is, could the same type of connectivity that's achievable through an app apply to Safari? In other words, does Safari's Internet connection mechanism force it to go through iOS' cellular data / wifi, or is it possible to allow the user to browse through a mesh?
I don't know much about iOS development and I suspect that websites opened through Safari don't have the authority to determine the sort of Internet connection mechanism that the device uses, but I wanted to ask if this is achievable by asking the user for permission or something like that.
Something that comes to mind is users' ability to download photos from websites to their file-systems, but then again they are the ones who are making the requests --the websites aren't asking for permission to save the photos.
The simple answer is no. You have no way to control Safari's network connection mechanism other than the options found in Settings->Safari.

Not able to view active servers through wifi and connect with it all the time by using Bonjour and NSNetServiceBrowserDelegate?

i am working on an App that uses wifi network to pass data from one ipad to another ipads .
i have already referred the following sample code about:
http://mobileorchard.com/tutorial-networking-and-bonjour-on-ip
The above sample code connects Devices using wifi and can exchange messages using Cfnetworking and Bonjour.
My problem is that i am not able to see Active Servers all the time .While Some times it Shows me Active servers and i can easily connect with and Exchange Messages but when i relaunch or open the app after some time it doesn't show me active servers so i am unable to connect and exchange messages. The same problem occurs in the sample code available from above link having tutorial on to Send data over wifi to another Devices.
I am Stucked up over here where i am unable to connect with active Devices all the time because not able to access those servers.
In chatty sample code same problem occurs where you can see active chat room's and connect with but some times you will not be able to see those active chat rooms availabe even if there are active servers who have already started new chat room where all Devices are connected to same wifi network.
Any help would be highly Appreciable , Thanks in advance.
Any chance the wi-fi interface on the device is going to sleep from disuse? Or that the user roamed to a different Wi-Fi access point with the same name that isn't bridged via Bonjour?
Have you considered using Multipeer Connectivity instead of using Bonjour directly? IIRC, that API would let you communicate even if the devices are not on the same Wi-Fi network, which is probably what you want anyway.

Resources