How to create Ad-hoc wifi in iOS - ios

I'm looking forward to create an ad-hoc wifi connection within my application on an ipod touch. Is there any framework available to do this in a simple way? I have to use my appication within an environment where no wi-fi or internet connection is available but different devices have to communicate over tcp/ip.

What you’re trying to do isn’t currently possible on iOS. Apps built with the SDK don’t get low-level-enough access to the Wi-Fi hardware to join or create networks, and the OS doesn’t let users create ad-hoc networks either. You might be able to wrangle Bluetooth into something useful here, but I wouldn’t bet on it.

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.

Multipeer Connectivity range and non ios device

I just started coding Multipeer connectivity with objective c in xcode. I have a few questions about the basics.
What is the range with Multipeer Connectivity? So if I make a chat program, will the two devices only be able to communicate if they are on the wifi network, or will they still be able to communicate if they are across the globe?
Will the program work with an ios device and a non ios device, so they can send each other messages? If yes, are there any extra methods or code that I need to add?
Thanks
As far as I understand MPC works over bluetooth and wifi- so if you are on a home wifi network, or a University campus network, your peers should be able to see one another. MPCis not for using across the globe that I know of...
This is an iOS technology only, iBeacon works across multiple platforms (iOS, android).
But, depending on what you want, you could make your app use internet to go across the globe, and you might be able to use straight bluetooth to connecto to a non-iOS device, then hook into MPC.
I would like to add to Keith's answer above that MPC supports peer-to-peer Wifi as well. This means that the devices involved don't need to be connected to an access point to talk to each other.
Also, the framework protects the developer (and end user) from the underlying technology (bluetooth, WIFI, P2P WIFI) used. In a given "session" between any number of devices (currently only up to 8 supported), each device could be using a different technology to talk to the others.

Is there an API that lets one sync an iOS app with its OSX counterpart via USB?

I am developing an iOS app, which may need to sync a large amount of data with its OSX counterpart app, and for the use case in which the app would be used there may not be an internet connection available to connect either of the devices (iOS device & Mac).
Is there an official apple api that lets one sync data between an iOS app, and its OSX counterpart, without having to use the internet or iCloud ?
As far as I can tell, short of joining the MFI program, there isn't a way.
If you don't mind the user dragging some documents around, then you can create documents which can be accessed via iTunes: http://www.raywenderlich.com/1948/itunes-tutorial-for-ios-how-to-integrate-itunes-file-sharing-with-your-ios-app
What makes you think you need an Internet connection for WiFi?
If you are close enough for a USB cable, just create a WiFi network from the Mac (WiFi icon in the menu bar, "Create connection..."). Use bonjour to discover services, and then the apps can talk to each other.

What is the mechanism used for having iOS devices communicate with each other?

Is is possible to have two iOS devices talk to each other without having a wireless network present?
If a network is required, can they communicate with each other without having a third device (a web server or something similar) to host the communication?
Yes, they can use Bluetooth or ad-hoc wireless network to the same effect. Apple in fact provides a framework designed to enable this: Game Kit.
See Apple's documentation on the subject for more information.

Is it verified that iPad cannot create ad hoc wifi networks?

Has anyone been able to verify that the iPad cannot create an ad hoc network?
It has different radio hardware (the fact that it does 802.11n demonstrates this) than the iPhones, which I thought was the reason that the iPhones could not create WiFi networks.
I know this was sort of answered elsewhere, but I wanted it to get proper attention with its own question and by more tag coverage.
Jeff, your god of biscuits. ;)
Just looked, and I can't see an option to create an ad hoc network anywhere on my iPad. If it's possible in the hardware, it's certainly not allowed by the software. IMO, I doubt that an app with that sort of functionality would make it through the app store process.
Wanted to update this question: as of iOS 7, the Multipeer Connectivity Framework provides a very high level means of establishing ad-hoc networks via WiFi and/or Bluetooth. It even bridges from WiFi from/to Bluetooth if some ad-hoc network clients have WiFi off and some have Bluetooth off.

Resources