Implementing Long Range Peer To Peer Data Exchange Over IOS - ios

I am looking for a solution to be able to send location data between two iPhones. I looked into Bluetooth data exchange but it is only a 10 meter range.
I have looked at Bonjour, however I haven't seen anything yet that would allow you to broadcast as a server over a 3g network. Is this possible?
Would I be able to use the Game Center for sharing data that is non game related?
Thanks In Advanced...

Not true. GameCenter just passes data. It has no concept of whether the data is game date, location data, or whatever.
Also, I dont think you can't use Bonjour to find devices over 3G. I believe you have to use a game center match invitation for devices not on the same local subnet.
If both devices are connected to the same wifi network, you can use Bonjour.

Related

Connecting 30 iPads

I am currently programming an app for my school.
During the lesson the teacher needs to send and stream data to the students. There is a case in which one of the students streams the data to everyone else. The teacher uses an iPad and every student uses one.
My question is: How could this be realized without a local network or an internet connection?
Two solutions came to my mind when thinking about it:
Multipeer Connectivity. The problem with this solution is the limit to 8 devices. I have read that you can open multiple sessions at a time but I am worried that 30 devices are too many.
Having the teacher-iPad open a hotspot which the other iPads join. This hotspot will be used as a local network to communicate (as far as I know, this works on Minecraft PE). This would only be an option if the hotspot and it's password could be configured by the app, otherwise it would be too complicated to use in a lesson.
Thanks a lot for reading my text. I hope that you can help me.
Your devices need to transmit using wifi or bluetooth. I have a recollection that MCSession stopped being able to use bluetooth a few years ago. MCSession may work only if all devices are on the same wifi network.
Probably you can first use Multipeer Connectivity to setup the network, then use a hotspot or other solution afterward.
For example, using Multipeer Connectivity to send the wifi name and password to other devices. Once a device receives the setup information, you can disconnect it so that other devices can get connected.

What's the best way to exchange data between devices locally?

I want to send data from 4-7 iPads to a MacBook and back for an application I plan on making that uses all devices and I want to avoid using a server for exchanging data. Also I would like to avoid connecting the devices over a local wifi network, as I would like my application to work regardless of wifi availability.
Is there a way of doing this using Bluetooth or a wired solution? Or maybe something else?
I think your best way is using apple Multipeer Connectivity, you can connect up to 7 nearby devices via Bluetooth, Wifi, or creat a local Wifi: https://developer.apple.com/reference/multipeerconnectivity

Is it possible to utilize carrier data and WiFi connections simultaneously within an App?

The theory in question is that I have a device that emits its own WiFi network. In order to communicate with this device, you must be connected to that WiFi network, but as it does not provide internet, your connection options are blocked.
What would be ideal, is to connect to this device, collect data from it, and transmit/push this data to a server located online via whatever means.
This question has been asked before, but the responses and questions I found were a few years old, and the OS has been updated a few iterations since then.
Is it possible, via Swift or Objective C within a mobile iOS app to utilize the connection of WiFi, but use carrier data to transmit that collected data?
I would use the BlueTooth API for this. However, there are two restrictions: 1) you cannot connect to a BlueTooth device in a captive network, and 2) you will not be able to connect to Android devices via BlueTooth.

inconsistent result from bonjour service in iPhone

In my iPhone/iPad app there is need to display list of devices connected the my router. Please refer the image the as shown below.
But problem is I do not get consistent result for example sometimes bonjour will detect 3 devices where-in actually it would be connected to 5 devices to router.
Is there any better alternative to bonjour to achieve the same functionality. Please suggest/advice on this.
Also it detects only iPhone/iPad devices only connected to network not any android devices connected to the same router.
Thanks
Bonjour is a good and fast approach, but it will only detect the devices that support Bonjour.
You could try to ping every device on the local network. The challenge here would be to determine the start and end IP addresses. It's pretty easy and this answer explains it very well.
You'll need to get the subnet mask and this is how you can do it on iOS.
This method is not going to work all the time and it will take 3-4 seconds to complete. This is why Bonjour (or other ZeroConf implementations) is really cool and useful for fast local device discovery.

How to get a list of wifi connections around me with its RSSI strength using Swift?

My app should scan Wifi signals around and list the network's name and its RSSI.
I can't find any clue on Google about how to do it. Could someone give an example or at least point somewhere else where I can find the answer?
I dont think its possible ! It doesnt matter if its Swift or Objective-C nor C++, the basic principle of iOS is that only system can connect to WiFi or turn on off those system setting. All you can get is info about the currently connected network. App sandbox in ios limits all other possibility.
It is only possible to get the SSID of the network that you are currently connected to.

Resources