iOS how to connect specific WiFi SSID with minimum user interaction - ios

I have to iphone applications that they use two different networks. Changing network setting for each application is not user friendly. I want to do such thing as follows,
When application starts, it checks the availability of particular network (SSID) and popup a message to the user to permit to connect. Once user click on "OK" they it connect to that particular network.
Anybody has similar experience ?
How can I connect to given SSID using objectiveC ?

I've been reading for a solution to achieve app controlled networking, but it seems impossible without the use of Apple80211 private API.
The best i think you can do is with CaptiveNetwork.
With this you can register a list of SSID's for your device and it will suppress web sheet.
From the doc:
By calling the CNSetSupportedSSIDs function, an application can register a list of wireless network SSIDs with Captive Network Support, thereby assuming responsibility for authenticating with those networks. Typically when a user joins a captive network, Captive Network Support provides a web sheet that allows the user to authenticate with the network. If an application has registered the SSID of the captive network, however, the web sheet is suppressed, and the user can complete authentication in the appropriate application.

Related

Connect to an already remembered SSID in iOS through Xamarin

I am implementing an app through Xamarin.
Is it possible to programmatically connect to an SSID which is already remembered by the phone in iOS?
No, it is not possible to connect to a known network, without providing the necessary credentials, due to various security reasons.
In order to connect to a network, you need to create a NEHotspotConfiguration
The class requires either only SSID (for open networks), or SSID with some credentials for authentication.
After the configuration is created, you can connect via NEHotspotConfigurationManager like so:
await NEHotspotConfigurationManager.SharedManager.ApplyConfigurationAsync(config);
NB: Keep in mind that to connect to a network, you need to enable the Hotspot capability in your App Capabilities Working with capabilities.

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.

Remain connected to wifi network that has a captive portal

There's a wireless network I'm connecting to using my iOS device. In order to access the internet, a captive portal page is displayed prompting for a username and password. I would like my device to ignore that page and remain connected to the wireless lan. I don't mind if I can't get on to the internet - I just want to connect to another device on the wifi network. I can do this on other devices (android, laptops etc), it's just iOS devices that seem to enforce a "use captive portal or be disconnected" policy.
So, is there a way for my iOS device to remain connected to a wifi lan that has a captive portal?
This is a well-known problem with iOS. Apple assumes, incorrectly in my view, that any iOS Wi-Fi connected device must access the Internet and must be able to reach Apple's servers (of which there are dozens, only one of which is apple.com).
The device chooses a server apparently randomly from a list and attempts to load a specific HTML file in a random file path from the chosen server.
If the device is connected to the Wi-Fi access point but can't reach Apple, iOS assumes that the user has not logged into the access point and thus must be shown the captive portal login page.
This has caused grief to developers who want the user device only to access web resources on the local network, where no Internet access is provided or needed; and when the access point is open with no login required. The captive portal page just confuses the user.
The solution is to spoof the Apple servers. The only way I know of is to configure a web server to note certain nonrandom content in the HTTP attempts from the user device, and to supply the file the device is looking for. This is how the LibraryBox and PirateBox do it. Check LibraryBox.us.

Automatically connect to a WiFi which has a specific SSID (atleast first few characters) from an iPad app

When a user walks into a physical store, is it possible to verify if a particular WiFi SSID is available (may be searching with first few characters) and if yes, can we automatically connect to that WiFi programmatically? Getting consent from the user for first time is OK, but if user gives the consent, we should be able to automatically connect subsequent times. I know Captive framework can be used to get the connected WiFi details, but can we leverage that framework to implement the above requirement as well? Appreciate any quick inputs.
No, this is not possible. You can indeed only get the SSID once connected.

Connecting to a special wi-fi network via iPhone App

I have to build an App that connects to a special Wi-Fi network and the opens an Ip address that is only available withing the network.
Is it possible to connect to a special wi-fi network (say "Network XYZ") via iPhone App. If so, please let know, so that I have an idea how to solve this.
Sadly no. Not from within the app.
All you can do is instruct user to go to settings and connect to that network.
If iPhone was not registered to any WiFi network before entering your app and your app has usesWiFi key set to YES then user will get a list of available networks to choose from.
One more big problem is: there are no AdHoc networks on this list - only infrastructure networks. AdHoc networks are available only trough settings.
What you could do is to instruct your user to set the auto-join feature on for desired network.
I'm afraid the only way to change the network is via the Settings application. Otherwise, rogue apps might be able to move users to their own proxies without the user's knowing.
It may be possible on jailbroken devices, however, as you would no longer be confined to working within the usual app restrictions on accessing system-level settings.
You can have your app launch once the user connects to the SSID you specify using the CaptiveNetwork API.

Resources