How to display a list of Wifi-Networks in an iPhone app? - iphone

I found some private (undocumented) APIs but Apple does not allow apps to use private frameworks. So does anyone know how to do this using Apple official packages?
like: when youtube app prompts you to the push notification: "Select a Wi-fi network"
Thanks in advance.

If you set the UIRequiresPersistentWiFi setting in your info.plist file, the iPhone OS will know that your app needs Wifi and pop up the message for you.
As far as I know, no app actually manually displays the wifi selection alert.

Thats wrong check this app out
http://itunes.apple.com/us/app/ihome-connect-setup-app-for/id450241802?mt=8
It shows available wifi networks

The best you can do in iOS, currently, is display the network the user is currently connected to. iOS doesn't allow you to access a wifi scan from within an app. I've been wrestling with this inability for some time now.
If designing an accessory that has WiFi, where you're trying to pass the user's WiFi network SSID and password, it will be up to the accessory to give the app that wifi scan list. The app can then display the list the accessory gave it to the user.
(I bet that's how the app #zaid pointed out in his answer, "iHome Connect", is doing it.)
Another approach is you could have a screen that prompts the user to enter the password to the wifi network they're connected to already, and then once the accessory is connected to the app, pass those details without the need for a wifi network list. I think that approach has a better user experience.
Plenty of stackoverflow questions that answer how to get the current wifi network, here's a couple:
Getting OSX Connected Wi-Fi Network Name
How do I get the current wifi network name after Yosemite in Swift?

Related

How to get available all wifi network name Listing in swift

I have a simple question but I don't know how to implement this. I need to create an app that can get all list of available wifi networks names and information when the user clicks on some network iPhone have to connect to this network. Can I do this? and How. Please Help me.
answer is no in some case you get list of nearer wifi but can't connect.(its also not advisable)
details :-
prefer below links to get wifi list:
How to get available wifi network name in iOS using swift
iOS Get list of all WiFi networks
some similar questions for reference:
Connect to WiFi programmatically in ios
connect to a specific wifi programmatically in ios with a given SSID and Password
Where do I find iOS Obj-C code to scan and connect to wifi (private API)
Programmatically auto-connect to WiFi iOS
The most interesting answer seems to be in the first link which points to a GitHub project: wifiAssociate. However someones in the third link explains that this doesn't work anymore with iOS8 so you might have hard time getting it running.
Furthermore the iDevice must be jailbroken.
i hope it will help you :)

How to detect all available Wifi networks and connect to one of them in an iOS app

In my iOS app, I want to detect all available wifi networks and then choose one network form the list and connect to it. The goal is to not open the Settings built in app to connect to a wifi, but to do it all in my app.
First, is this possible? If possible, please point me to what framework(s) and methods to use.
I have looked at the Reachability example, but that doesn't work for me because, I think, all it does is monitor the network state of the device.
I also looked at the Captive Network Support framework, and used the CNCopySupportedInterfaces function:
CFArrayRef allWifiNetworks = CNCopySupportedInterfaces();
NSLog(#"%#", allWifiNetworks);
but all I am seeing is the current wifi network that the device is connected to.
Thanks
I'm pretty sure you can't do this, at least not if you want to be able to publish on the App Store.

iOS Bluetooth printer?

Does anybody suggest a mobile printer able to print receipt with a good SDK to interface wireless an iOS application adhoc developed ? The printer should be small and should use rechargeable batteries for field use.
I cannot use wifi because not always a trusted access point (customer premises) is available, so I think to use Bluetooth, but of course any suggestion is welcome !
FYI I already checked Zebra printers SDK for iOS but it seems able to print only using a TCP/IP address, it means (for as I know) I should use wifi. In my case the application should be used in the field from an iPad connected with cellular network. In iPad there is no hot-spot and not always there is an available wifi access point tho connect the iPad and the printer the the same network to use TCP/IP addresses. That is the reason I'm guessing the last chance should be bluetooth.
Unfortunately iOS5 does not support Bluetooth printing.
http://support.apple.com/kb/ht3647
Have you considered VPN via WEP to a network printer?
Alternatively some printers can be set up with their own email address. PDF attachments can be sent via this address to be printed. These emails can be sent encrypted.
I know that this isn't the IDEAL answer, but it is likely to work for the time being until iOS is properly updated.
Yes, I have Bluetooth printer for IOS device, it is Apple MFI approved
see details from this URL http://www.bluebamboo.com/other_file/P25i%20Datasheet%20%28EN%29%20v1.0%2009-Oct-2011.pdf
I know you already accepted an answer, but here's another one: have the technician bring their own wireless base station (AirPort Express perhaps) and create his own wireless network (that won't have internet access, but that's not needed) with appropriate security. Then you can use any HP wireless capable printer and have the iOS device and the printer connect to the wifi network created by the wireless access point (which should be set with DHCP to vend IP addresses in a non-routable range like 192.168.x.x, obviously).
We also have a Bluetooth printer that is MFI certified along with an easy to understand iOS SDK. Please take a look at the EZPay App on the Appstore. The app's currently in Japanese (fir one of our clients) but the description explain a little about the printer. I'm currently traveling at the moment, but if you shoot me an email from the contact info on the App Store. I can get a few other things out to you. Cheers... B
No need to develop a full blown SDK, check out Mobi Print. it has the Zebra sdk already implemented and connects to any webservice or ODBC database. It also has stored label/receipt formats in there app so just upload your format and should be good to go.
here is link for Mobi Print

Xcode IOS Connect to a specific wireless network using SSID and Password

I'm currently creating an iPhone app (Xcode 4.3.1, IOS 5) that has to work with wi-fi routers! Main goal of this application is indoor navigation (GPS inside buildings isn't really accurate).
One solution could be to scan all available wi-fi and then my application could make it's job! But as far as I looked into all documentations and dozens of articles, Apple doesn't provide any API to scan available wireless networks (actually there are some ways to get around this problem, but if you use them your app will be rejected from AppStore)..
Second solution could be just to connect to specific wi-fi access points!
All these access points are pre-written inside code, something like:
SSID: myHomeWifi; Password: somePassword; ... etc.
My app could try to connect or at least access or ping each of these routers and then make calculations.
So the question is.. is there any way to make connection with some wifi access point if I have all private data of the router?
any advice would be appreciated!
thanks!

How to change connection from 3G to wi-fi programmatically using iPhone SDK?

Lets consider that I am connected to internet through 3G in my App. When a wi-fi hot spot seems to be appearing, can I programmatically switch to the wi-fi. Is this vice-versa condition possible?
iOS does this automatically by itself!
If no known WiFi network is found, it uses cellular data. If it finds a known WiFi-network, it connects to and uses that network instead.
If any WiFi-network is found, and your application requests access to the internet, iOS (usually) automatically presents an alertView and lets the user log in to a WiFi-network. If the user does not log into a WiFi-network, it stays on the 3G-network. When iOS 7 comes, iOS may connect to Hotspot 2.0 networks automatically as well.
Apple keeps individual apps on a tight leash, and so they do not let apps control things like this.