Setting up communication between multiple iOS devices using NSNetServices class - ios

I am able to set up communication between multiple devices using NSNetServices class but only when those all devices are on same wifi network. Is it possible to make all the devices communicate regardless of the network availability, means it shouldn't matter if they are connected to same network or not connected to any network at all, just their wifi and bluetooth is on.
And I don't wanna do it using MultipeerConnectivity framework.

Related

How can I make both Wifi and Mobile Data Network of iPhone working simultaneously?

I'm working in a camera app where I need to use cellular data while iPhone is connected to the camera device via WiFi.
But my app can't use cellular data when iPhone is connected to camera via WiFi. How can I connect to both WiFi network and mobile data network simultaneously in iOS ?
Manually I know its possible by connecting iPhone to a WiFi network and then uses its STATIC protocol instead of DHCP protocol.
But how can I make it user friendly by doing this task programmatically ?

Reachability reports Wifi when HotSpot is On via USB

When I tether my mobile network to laptop with Hotspot on iPhone and test for Reachability's currentReachabilityStatus it reports ReachableViaWiFi where neither Wifi is open nor is it sharing mobile network via Wifi.
I know even with this, it shows correct information on internet connectivity but the nature of my app requires exact information on whether Wi-fi is connected or not so its not the issue to determine internet connectivity but more of Wi-fi reachability.
x----x----x----x----x----x----x
EDIT:
Infact it fails if there is no device connected on USB. Only reports ReachableViaWiFi when a machine is using its internet via USB.
Open this post: detect hotspot enabling in iOS with private api's
Maybe enumerating network interfaces will let you discover the fact that connection is actually a tethered cellular network.
Don't worry that title includes private API - the solution contains also a way to this without using private API.

RSSI through Multipeer Connectivity Framework

Is it possible to detect the signal strength of a connection between two iOS devices by using Multipeer Connectivity Framework?
Unfortunately, it's not possible. I think there is a good reason for this. As you can read in the docs:
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).
In case of infrastructure Wi-Fi network, there is no direct connection between two iOS devices as they communicate through an access point. Therefore you can't get the signal strength of a connection, because it simply doesn't exist.
If you want to get RSSI, you can use Core Bluetooth framework instead.

Is there a callback/delegate to tell that the device is back to be connected (to carrier service or wifi) after offline?

Assume a device was offline with no service neither WiFi to begin with, is there a callback/delegate to tell that the device is back to be connected once the service or WiFi is available? or do we have to proactively pull the status?
You could check it with the Rechability class:
The Reachability sample application demonstrates how to use the SystemConfiguration framework to monitor the network state of an iPhone or iPod touch. In particular, it demonstrates how to know when IP can be routed and when traffic will be routed through a Wireless Wide Area Network (WWAN) interface such as EDGE or 3G.
here is an Example

Communication between ZigBee and Bluetooth

Bluetooth and ZigBee devices are working or pairing within its own family devices based on parameters such as network layers, security algorithms, etc... I want to write an application to make a communication between ZigBee and Bluetooth device. Is it possible?
You would need to create a gateway between the two networks. Your application would need to interface with a ZigBee radio and a Bluetooth radio, join each network, and then proxy communications between devices on the networks.
What devices do you plan to bridge? Your application will need to appear as device X on the ZigBee network, and device Y on the Bluetooth network and convert data received to the correct format to send out on the other network.
If it were kept simple, something like this could work. A module that is a Zigbee presence, with a pairable bluetooth node. If a bluetooth-paired device comes near, the Zigbee announces itself as 'present'. When the bluuue tooth paired device is no longer around, the Zigbee device becomes "not present".

Resources