Retrieve the WPA2 Enterprise username in iOS - ios

I have an interesting requirement that I'm not sure is even possible. Currently, I'm developing an iPad app for a fleet of tablets. The tablets connected to a WPA2 Enterprise WIFI network. Is it possible using Objective-C or Swift or C magic or whatever is necessary to get the identity/username that is connected to the wireless network?
I've poked around CaptiveNetwork, but it doesn't seem to be what I want. I'm not sure if there is something to CWNetwork, but that seems to be Mac only. You can do this on Android (I know, because I'm currently doing it with the key android.net.wifi.WifiConfiguration$EnterpriseField).
Can anybody help?

I did some reading and was thinking this would be possible through SCPreferences in the SystemConfiguration framework, but unless your device is jailbroken, the APIs you need are not available on iOS.

The only way that comes to mind is with an MDM such as AirWatch or Good.

Related

How to connect to USB device from iOS with Xcode or swift

I'm trying to connect USB camera to iOS in Xcode using Swift or Objective C.
I saw online to try and use IOKit.framework, but I believe it's for MAC, which I'm not using. dos NSSstring converters but I'm unsure that will work either. I'm trying to do it through iOS.
I also have a WIFI adapter that will connect to my NIKON DSLR and shoot photos to a PC over wifi but not sure how to get the iOS device to connect and download these images.
Thanks in advance!
Looks like this isn't possible, at least for what you want.
Communicating with an external accessory requires you to work closely
with the accessory manufacturer to understand the services provided by
that accessory. Manufacturers must build explicit support into their
accessory hardware for communicating with iOS. As part of this
support, an accessory must support at least one command protocol
These USB devices obviously have not been designed with iOS in mind, so there is a very small chance you can get it to work the apple way.
Alternatively, you can look into jailbreaking and that sorta deal with the cameraconnectionkit library. This is way out of my scope though, so good luck!

How to restrict WiFi change on iPad

I have this solution for my customer's retail stores - they have iPad Air 2, with iOS 8.1.3, router and workstation with large TV and it's absolutely necessary that the iPad will stay connected only to WiFi I am providing with those routers. If anyone changes to another hotspot, the solution won't work. So I am looking for some ways that will prevent that, either in settings or via some app..
Also, it might work with apple configurator, but I couldn't find any site where it is mentioned.
Thx for advices
Unfortunately there is no means to restrict iOS devices to a single WiFi, even with an MDM and device supervision. I have a close relationship with Apple and this has been ask from education and retail partners for over 4 years now. I feel your pain.
A "workaround" for this would be possible if you happen to be using a single app that you have developed to access these resources. If that is the case you can either interrogate which SSID the device is attached to and throw a warning if it is not correct. There are also a myriad of other examples like this to detect the wrong SSID or spoofed SSID but no way to currently lock the device to the correct SSID.

RS232 for iOS device

Is it possible to pair an iDevice to an rs232-bluetooth adapter for the purpose of sending serial commands like it would through an iDevice dock connector to rs232 (just like the Redpark Serial Cable does)? I ask because the company I work for is thinking of having an iDevice control one of our systems for demo. I know it doesn't relate to anything specific but any information would be greatly appreciated.
(See also iPhone to RS-232 via Bluetooth)
Bluetooth modules exists that support MFi (Made For iPhone) such as this one from connectBlue http://www.connectblue.com/products/bluetooth-products/bluetooth-modules/bluetooth-iphone-ios-accessory-module-obs414/ So the standard iPhone Bluetooth stack can make a SPP/RFCOMM connection to that device. That device could be added to a board along with RS232 level-conversion etc... And thus success.
I don't know whether someone sells such a device. The RS232 device that connectBlue sells seems not to support MFi, http://www.connectblue.com/products/bluetooth-products/bluetooth-devices/bluetooth-rugged-serial-port-adapter-rbs433/
Not really. The GameKit is one way to access bluetooth in iOS, but it is very limited in what that API allows you to do.
Depending on what you are building, you might be able to use the Apple Made for iPod program, but it's probably a long shot.
http://developer.apple.com/programs/mfi/
The best way to go is probably to design a device that connects via WiFi. I've gone this route, and it worked out well. If you must interface with something with an RS-232 interface, you might design an intermediary "adapter" that connects via WiFi to the iOS device, and via RS-232 to the other device.
If you don't have a need to distribute your app via the App Store, you can use Redpark's iOS serial cable: http://redpark.com/c2db9.html. (Disclaimer, I've never tried one, but according to someone at Redpark, jailbreaking is not required, you just can't distribute your app on the app store.)
You could design a small dongle that attaches via the dock connector, and broadcasts over bluetooth to your other device.
Or you could use WiFi instead of bluetooth... perhaps communicating over WiFi to something that's physically plugged into whatever you want to control.
I worked on a jailbroken app which used BTStack to communicate with a serial device. You might be able to use this for your demo.
If you're still looking to use bluetooth, this helped me out alot to facilitate the standard serial connection for prototyping without jailbreaking:
http://www.seeedstudio.com/depot/bleshield-based-on-bluegigas-ble112-module-p-1367.html
It works on the Bluetooth 4.0 enabled iOS devices and all of the schematic, boardfiles, firmware sources and the iOS App sources are available here:
https://github.com/michaelkroll/BLE-Shield

IPhone Bluetooth Connectivity to Non IOS Devices

I was wondering, if there is a way to use IPhone as an HID device, with some other device like PS3. I checked out the Bluetooth specification and IOS Devices do support HID Profile. So I thought it would be easy to pair my iPhone using passkey mechanism and should be able to start using my iPhone as keyboard or mouse without much hassle. But I found very soon that this assumption is naive and I need to develop custom solution.
I was initially thinking about using GameKit framework, but I think it only works between two compatible IOS Devices. If I want to extend this capability, then I have to use iPhone External Accessory API .In my analysis, I also found that iPhone will only communicate and pair with devices that are licensed by Apple. (Made for iPhone\iPod program). Does it mean that, if I want to use iPhone with another device, I need to get that device approved by Apple. ( Which will not surprise me one bit). Also if someone could point me to more detailed documentation on this, that will also be helpful.( What is an MFI developer board ??)
I do not want a solution that needs me to jailbreak an iPhone. (or any solution that will disqualify my app by Apple).
So to summarize:
1- Please validate my findings, correct them if they are wrong?
2a- How does External Accessory API Work?
b- Can I use this to connect to third party accessories ? (or is this only for accessory developers).
3- Or is there a better solution without using External Accessory API?
Please provide supportive documentation or link if you can. Thank You.
You are unlikely to get on the External accessory program from apple unless you are a big company ( you can try, but I have read this a number of places) . iPhones use a proprietary Bluetooth interface that and hardware must also implement this interface, so not much chance of getting it to connect to any other hardware directly.
Most apps like this (Remote Mouse) for example, connect to your wifi network, and have another application installed on your computer. The iphone can then talk to this application over the wi-fi network, but not bluetooth. I would suggest that the only way I can see this would be possible to to create the server app that you install on a computer on the wi-fi network that then in turn controls the 3rd party device if there is an API that you can use from the desktop app to control the 3rd party device.
This is just what I have found when I researched about this for making an app for iPhone to control a bluetooth watch. I had to jailbreak in the end to replace the bluetooth stack on the iPhone with one that could connect to any hardware device. Not limited by apple.

OS X to iOS communication via USB?

Is there currently an Apple-approved (or at least tolerated) strategy to transfer high-bandwidth data over USB from an iOS device to OS X? Is this even allowed as an MFi program developer?
Maybe peertalk is interesting. "PeerTalk is a iOS and OS X Cocoa library for communicating over USB and TCP."
I would take a look at this project from iOSDevCamp 2010 if you want to transfer data over USB:
http://maxweisel.com/blog/2010/08/iosdevcamp2010-hackathon-ios-usb-sync/
Perhaps this doesn't map to what you're actually trying to do, though.
There is no legitimate way to do this using the public iOS SDK at the moment.
It is also impossible to do that within the MFi, unless you want to put a peripheral in between.

Resources