NSNetService on WiFi instead of bluetooth - objective-c

I have 2 iOS devices and an application which starts or connects to a NSNetService.
When both devices have have bluetooth turned on the data stream will automatically be done over the bluetooth interface.
I do not want that, i want both devices to communicate over the WiFi. Is there a way to force a NSNetService to communicate over the WiFi?
Thanks

I don't think there is, I haven't looked into the docs, but I know a ton of games recommend disabling Bluetooth and ensuring WiFi is enabled for local multiplayer.

Related

Does google nearby use WiFi P2P

Having read the announcement about google nearby 2.0 it's clear that WiFi connections are supported.
Nearby Connections uses WiFi, Bluetooth LE & Classic Bluetooth under the hood to discover and establish connections to nearby devices.
Or from the docs overview page
Under the hood, the API uses a combination of Bluetooth, BLE, and Wifi hotspots
What I'm not clear on is whether the WiFi support is exclusively when devices are connected to the same WiFi router, or whether the service will also use WiFi P2P (aka WiFi Direct) to establish connections when possible.
My experience using similar services on other platforms is that bluetooth connections can often be too slow for fast paced multiplayer games. My title already supports connections over WiFi routers, so ideally I'd want the service to add WiFi play in the absence of a router.
I think my question is answered in the I/O talk about Nearby Connections refresh (link).
We connect over bluetooth and start transferring data instantly, but
in the background we also bring up a WiFi hotspot, and when that's
ready we seamlessly transfer your connection from bluetooth to WiFi
with absolutely no work required by the app developer
I'm reasonably confident from the context that the WiFi hotspot they're talking about is an Adhoc/Direct/P2P one (not sure of the correct terminology, but mobile to mobile WiFi of some sort) rather than a physical router.
The announcement says
At I/O this year, we spoke about a refresh to the Nearby Connections API that can provide high bandwidth, low latency, encrypted data transfers between nearby devices in a fully-offline P2P manner. Today we're announcing the availability of this API across all Android devices running Google Play services 11.0 and up.
Its fully offline and P2P so it looks like that there is no need for them to be connected to the same wifi router.

Connecting iphone with external device through bluetooth or wired connection

I have an external device that we need to connect with iPhone by using either Bluetooth or wired connection.
For connecting with Bluetooth we know that if the device has BLE then we can directly communicate with it Using CoreBluetooth Framework.
Otherwise we have to go to get it MFI registered.
Also if we want it to connect it using wired connection then also we have to get it MFI registered.But we have found a cable that connects device with iphone and that cable is MFI registerd. So if i use this cable for connecting iphone to device still do i need to get my device MFI registered??
For configuring this device initially i use desktop (putty). Through LAN cable i insert one end lan cable in device and second end in my computer, then using (putty) serial communication (through COM port) we send some commands to configure it. So, can this be done through iphone also if the device gets connected to iphone through usb cable??if Yes then how???if yes through bluetooth then how??
From the developer of that cable's website
"MFI Certified
All Redpark cables are licensed through Apple’s “Made for iPod” (MFI) program and have earned MFI certification.
Apps developed with our SDK can be deployed under your Apple Enterprise Developers license with no further review or approval from Apple."
Key here is Apple Enterprise Developers license. If you're developing this application for internal release within your company it seems you don't need MFI. To be released on the app store I believe you would still need MFI.
As far as I know to configure your device from the phone rather than through your desktop would require a jailbroken phone. See here for a little info http://www.computerworld.com.au/slideshow/365979/great-iphone-serial-port-hack/?fp=4&fpid=5

Connect to a bluetooth device programmatically objective c

Is it possible to programmatically connect to a bluetooth device. So, without having the user to open the Bluetooth settings and select the device they need to connect to. Note: The device it needs to connect to will always have the same device name.
Yes if you use Core Bluetooth to discover all devices that are discoverable. Then if it matches a name etc then connect to it.
I made a wrapper around Apple's Core Bluetooth framework to make it easier to do these things.
https://github.com/steprescott/SCPCoreBluetoothManager

Can my iphone app communicate with a connected computer?

Preferably, this would be a computer connected via cable, but if there's a way to do it over wifi then this would also be useful. I'm wondering if it's possible to send messages between them?
Or if i had a mac app and an iPhone app, could I communicate between them over wifi or a usb connection, rather than using a server or something?
Connecting over WiFi is possible, cable connection however isn't possible (certainly not in the documented API) unless the phone is jailbroken.
For wifi you're just going to connect to a TCP/IP host/socket. Have a look at CocoaAsyncSocket. The computer would need to be hosting some sort of server software. This is how iTunes Remote and AirMouse work.
There are some "permitted" (non-cracked phone) ways to send data to the iPhone from a device that's physically plugged in. There are several barcode readers - like the Linēa-pro used in US Apple stores - and magstripe readers for credit cards (e.g., the Macally Quikswipe) that can send limited amounts of data to/from the iPhone.
If your computer is a small embedded device and your data requirements are meager, it may be possible.

How to detect that Symbian phone is being used as a modem?

I have a Nokia Symbian Series 60 3rd edition phone. I can use it as a GPRS / 3G modem either using Bluetooth, USB or IR.
Is there a way to programmatically detect when the phone is being used as a modem?
Please note I don't want to detect when a GPRS / 3G connection comes up (such as when you use the phone browser), but when a GPRS / 3G connection comes up that is the result of the phone being used as tethered modem via BT / IR / USB.
So the user has set up a dial up networking connection on their laptop, for instance, which uses the modem in the phone. They then launch that connection because they want to make a 3G wireless internet connection from their laptop via the phone. That's what I'd like to be able to detect from the phone.
I don't believe there's any public interface that you could use for this. You could probably use internal APIs to check what is creating the data connection, or more crudely check which processes are running when a data connection is created - probably quite easy to fool this method, depends why you want to know?
I can see network operators wanting to do this to block and/or charge extra for tethering usage. Easiest way to do that would be network side though, checking the browser UA header (also possible to fool, but not without harming your browsing experience a bit on the laptop).