Wi-Fi Direct and iOS Support - ios

I want to use Wi-Fi Direct in a solution, but I'm unsure which platforms support it.
Does Wi-Fi Direct depend on iPhone/iOS version?
Can I develop an application with Wi-Fi Direct feature on a iPhone 4s with iOS 8.

It took me a while to find out what is going on, but here is the summary. I hope this save people a lot of time.
Apple are not playing nice with Wi-Fi Direct, not in the same way that Android is. The Multipeer Connectivity Framework that Apple provides combines both BLE and WiFi Direct together and will only work with Apple devices and not any device that is using Wi-Fi Direct.
https://developer.apple.com/library/ios/documentation/MultipeerConnectivity/Reference/MultipeerConnectivityFramework/index.html
It states the following in this documentation - "The Multipeer Connectivity framework provides support for discovering services provided by nearby iOS devices using infrastructure Wi-Fi networks, peer-to-peer Wi-Fi, and Bluetooth personal area networks and subsequently communicating with those services by sending message-based data, streaming data, and resources (such as files)."
Additionally, Wi-Fi direct in this mode between i-Devices will need iPhone 5 and above.
There are apps that use a form of Wi-Fi Direct on the App Store, but these are using their own libraries.

The official list of current iOS Wi-Fi Management APIs
There is no Wi-Fi Direct type of connection available. The primary issue being that Apple does not allow programmatic setting of the Wi-Fi network SSID and password. However, this improves substantially in iOS 11 where you can at least prompt the user to switch to another WiFi network.
QA1942 - iOS Wi-Fi Management APIs
Entitlement option
This technology is useful if you want to provide a list of Wi-Fi networks that a user might want to connect to in a manager type app. It requires that you apply for this entitlement with Apple and the email address is in the documentation.
NEHotspotHelper
MFi Program options
These technologies allow the accessory connect to the same network as the iPhone and are not for setting up a peer-to-peer connection.
Wireless Accessory Configuration (WAC)
HomeKit
Peer-to-peer between Apple devices
These APIs come close to what you want, but they're Apple-to-Apple only.
NSNetService
Multipeer Connectivity
WiTap Example Code
iOS 11 NEHotspotConfiguration
Brought up at WWDC 2017 Advances in Networking, Part 1 is NEHotspotConfiguration which allows the app to specify and prompt to connect to a specific network.

According to this thread:
The peer-to-peer Wi-Fi implemented by iOS (and recent versions of OS
X) is not compatible with Wi-Fi Direct.
Note Just as an aside, you can
access peer-to-peer Wi-Fi without using Multipeer Connectivity. The
underlying technology is Bonjour + TCP/IP, and you can access that
directly from your app. The WiTap sample code shows how.

Related

Does iOS Multipeer connectivity work with non-smartphone devices?

Our guys in the field use equipment that have wifi and Bluetooth connectivity. One of our users has been using a non-iPhone (I guess Android) to transfer files between his phone and the equipment through Bluetooth. However, in switching our users to iPhones to use other enterprise apps we have discovered what some of you already know: iOS's Bluetooth connectivity is severely limited (i.e. no SPP protocol).
The equipment also communicates via wifi, so I was wondering if it's possible to create an app using iOS Multipeer connectivity to solve the Bluetooth problem. All I am finding about this, though, doesn't show anything but phone-to-phone multipeer connections, and not phone-to-machine multipeer connections.
At this point I know nothing about how the field equipment works; that's something I'll have to learn if we decide to pursue this. But assuming that it is capable of discovering wifi networks, would it be able to see the iPhone's network without needing any special software?
Or would I be wasting my time trying to figure this out?
Thanks!
If the equipment is using Bluetooth SPP then unless it is MFi certified you can pretty much forget about connecting to it from iOS. Multipeer connectivity won't do it, that's for sure.
WiFi may be a possibility - you need to get the iPhone and the equipment on the same WiFi network - you can't do this via an app though - you would need to use the WiFi settings in iOS - You will need to learn more about the equipment to see if that is possible.
Short answer: no. Only iOS 7.0+ or MacOS Yosemite+
MultipeerConnectivity is a framework for iOS and Mac OS. To send data using it, you need both devices to have iOS or MacOS with MultipeerConnectivity. You don't have any network-related parameters like "I prefer using bluetooth or wi-fi", it was designed to "just work out of box with simple goal - discover and connect other devices with MultipeerConnectivity.
It means that you can't send data from iPhone with MC to Android or Symbian or old iPhone with iOS <7 etc.
Before iOS7 you could use GameKit, but the logic is the same: both peers need to use GameKit.
If your custom equipment does not have iOS - you need to use lower-level API, and your options include generic Bonjour (NSNetService on iOS device and something Bonjour-compatible on custom device) or CoreBluetooth (obviously bluetooth-only, no wi-fi peer-to-peer) on the lowest level, using sockets and so on.

iOS device communication with bluetooth enabled device

I have a specific requirement to communicate an iOS device with a wifi/bluetooth enabled device. At this moment, I'm confused with some points and requires an expert advice.
Can I use adhoc wifi method for communicating? but in this case, can I connect to another network? On my research, I found no so I'm opting for Bluetooth.
If I go in bluetooth communication,
Do the device need MFI licensing or can we use classic bluetooth?
From few blogs I found out that Bluetooth low enrgy devices with 4.0 can be used to communicate with ios without licensing. Will this work?
PS: My requirement is to send strings of data to and fro from the ios and other wifi/bluettoth enabled devices.
An iOS device can only be connected to a single Wi Fi network at a time, so an Ad-hoc network connection probably won't work for you.
If you join the MFi program you can use the Wireless Accessory Configuration (WAC) feature to simply the process of connecting your device to the user's existing network.
If you use Bluetooth Low Energy/Bluetooth Smart/Bluetooth 4.0 then you don't need to go through the MFi program, but you are limited to iPhone 4S and later and iPad 3 and later. If you use "classic Bluetooth" (Say Bluetooth 2.1 Serial Port Protocol) then it will work with all devices but you need to go through MFi.
Bluetooth Low Energy isn't great for high data volumes (say video streaming) but is fine for smaller amounts of data (you talk about "strings" so it will probably be suitable for you).
The other advantage of BLE is that it is independent of the iOS device's Internet connection so the user can cary the BLE device around and maintain communication regardless of their WiFi connection.

How can Multipeer Connectivity Framework (iOS7) be used, when there is no Wi-Fi router nearby and also the bluetooth interface is turned off?

I just discovered that 2 (or more) peers can connect to each other (and also send data) without being connected to a router nor having bluetooth turned on.
From Apple's documentation I can read out that additionally to Bluetooth PAN and infrastructure Wi-Fi also peer-to-peer Wi-Fi is supported - is this the reason why it is still working or is the framework still secretly using Bluetooth?
(PS! The devices, which I am using do not have a cellular chipset implemented)
Yes, modern iOS and OS X devices can talk to each other using wifi without being connected to a router.
It's used for all kinds of things.

Connecting iOS a set of iOS devices with Wifi network

I'm searching a new way to sync data between iOS devices connected to the same Wi-fi network.
My app uses iCloud to sync its CoreData UIManagedDocument, but iCloud latency is too big for my goals.
Is there some way to connect iOS devices in the same Wi-Fi network with the iOS SDK? Any ideas?
Thanks
Any two IP-capable devices can connect to each other using BSD sockets - I've written an Objective-C wrapper to facilitate networking operations like this - here it is.
From iOS 7, you should look into the Multipeer Connectivity Framework. It allows connections between iOS devices on the same Wi-Fi network or Bluetooth personal area network, and the API is extremely simple to use.
You can use Gamekit to connect with both WiFi and Bluetooth and send data back and forth.
There's an excellent but lengthy tutorial here http://www.raywenderlich.com/12735/how-to-make-a-simple-playing-card-game-with-multiplayer-and-bluetooth-part-1
you should be able to pick out all the connectivity bits.

Is Wi-Fi Direct connection possible within iOS devices and among Wi-Fi Direct enabled devices?

Is Wi-Fi Direct connection possible within iOS devices and among Wi-Fi Direct enabled devices?
The objective is to enable communication between an iOS device and another device (not necessarily another iOS device. It could be Android, Mac, PC) without the presence of any controllers. (WAPs).
iOS devices can connect to an ad-hoc network, and if they do so they will have full wireless network capabilities. The limitation is with creating an ad-hoc network from the device itself, which is not allowed/not possible.
An alternative would be to use the GameKit/Game Center API which uses Bluetooth to create a network between iOS devices. This would obviously include the more limited range of Bluetooth vs Wifi, as well as the constraints of Apple's SDK.
More information on Game Center in iOS 6 is available here: http://developer.apple.com/library/ios/#documentation/NetworkingInternet/Conceptual/GameKit_Guide/Introduction/Introduction.html#//apple_ref/doc/uid/TP40008304
I have been looking into this recently and from my research,(please see "Device to device communication with WiFi Direct: Overview and experimentation" by Daniel Camps-Mur,....) the WiFi Direct does NOT create ad-hoc network. It's actually creating a WiFi infrastructure network where one party takes the role of AP (soft-AP). Once this established, the network works much like a normal WiFi network. Do we agree on this?
Given this is the fact, Apple iPhone should be able to connect to WiFi Direct device that is already set up as AP. I haven't check this though.
Having said this, How can you get an Android phone like Samsung Galaxy S3 or S4 to act as AP? there is nothing in the settings as far as I know. If you connect two such devices, one of them will take the role of AP. Now, iPhone will detect the established network, but when trying to connect to that, will be asked for WPA password. Good luck finding it! Cus you can't get it from the phone. I read somewhere that a file in Samsung Galaxy called WPA_Suppliciant.conf has the WPA key in it but I didn't see it there.
I believe if you could find WPA password, you can get the iPhone to easily connect.
iOS devices do not support Wi-Fi Direct functionality, they do not have WFD (Wi-Fi Direct) group creation or role negotiation (P2P Group Owner or Group Client) support.
During a normal WFD connection one of the 2 devices takes role of Group Owner (Soft-AP) allowing other device to connect as a Group Client.
iOS has support for tethering which is normally know as Personal Hotspot option in Settings. It can be used for communication between iOS and non-iOS devices. For example,
Application ShareIt uses similar way to connect iOS to non-iOS devices by creating a temporary Hotspot and in the non-iOS device and promts iOS user to go to Wi-Fi screen and connect manually. This is normally recommended when a common Wi-Fi network is not present.

Resources