How can I find the list of all available nearby devices, even if they don't have my app? - swift

Follow up for this post from Jul. 2020. I want to know if it's possible to programmatically access the total list and number of available devices around me, even if they don't have the same app installed; similar to what AirDop does.
I've looked at Peer To Peer, Nearby Interactions, Bonjour framework and all of them require the same app to be downloaded.
Any thoughts?

You can't do that since all mentioned frameworks need to run same type of session with another devices, which is (currently) impossible without an app.

Related

Peer-to-peer communication between iOS devices

I am trying to prototype a solution to a problem and am currently exploring multiple routes I could try. Is it possible for one iOS device, running a certain app, to communicate directly with another iOS device, running the same application - without the need to be on the same LAN?
Solutions I am currently investigating are using Bluetooth and ad-hoc wireless connections.
Ideally, the application when installed would ask the user for the required permissions, and then would accept and/or send data to/from another client after a handshake had happened.
My concern with Bluetooth is that 'pairing' would need to happen with every device, rather than happen in the background once the user has installed the app. I have a feeling what I am talking about isn't possible from what I've been reading elsewhere on Stackoverflow.
Take a look at Bluetooth Low Energy.
https://developer.apple.com/library/ios/#samplecode/BTLE_Transfer/Introduction/Intro.html#//apple_ref/doc/uid/DTS40012927
Here is another example,
https://github.com/KhaosT/CBPeripheralManager-Demo
You might also want to look into GameKit and peer-to-peer connectivity there.
I can't tell you anything about it, but you might try looking at iOS 7. If that's an option, I'd take a look. Can't talk about what it is because of NDA though.
Depending on what you need to communicate, you could try checking out this project, which lets you share arrays of strings between iOS devices over Bluetooth LE.
You don't need to "pair" the devices and it can still communicate while the app is in the background. SimpleShare
Hope it helps!
From the documentation of MultipeerGroupChat:
MultipeerGroupChat sample application utilizes the Multipeer Connectivity framework to enable nearby users to discover, connected, and send data between each other. This sample simulates a simple chat interface where up to 8 devices can connect with each other and send text messages or images to each other. Here you will learn how to bring up framework UI for discovery and connections and also how to monitor session state, listen for incoming data and resources, and send data and resources.
This is an excellent example at developer.apple.com here is the link
https://developer.apple.com/library/ios/samplecode/MultipeerGroupChat/Introduction/Intro.html
Also this tutorial from Ralf Ebert demonstrates how to use Multipeer Connectivity framework for peer communication should help you.
https://www.ralfebert.de/tutorials/ios-swift-multipeer-connectivity/

Share text between iPhone and other phones using wifi

Is it possible to send and receive data between iPhone and other phones such as blackberry or android over wifi. I am on the move it to create an iPhone app with the above functionality. Can any one has previous experience in this, or any sample codes to do this. I have searched a lot but couldn't find anything relevant.
you can do this by using a server application. So the iphone pushes the data to the server and the other devices are either getting push notifications or something similar or simply poll for the data.
Without a server, you have the trouble of finding the other devices. If its safe to assume they are all on the same subnet, then you could use a UDP broadcast to do this.
There's many ways of doing this, every one with its own pitfalls. So there's no generic answer to this question without knowing in more detail what's the purpose of it.

Google-TV device not found to pair with Google Anymote

In building the Google Android app for Anymote tv control (I've got some Sony Google TVs to work with), I never actually seem to find the TV when I run it - just getting "No Google TV devices found on ". I've tried it on an actual phone (not just the emulator) and have also tried the TV "connect" pairing button, but it never seems to find anything. Both the phone and the TV are on the same WiFi network. Anybody get this to work?
Does the google-tv-remote app work on your sony google tvs? If so then I would check the source for that app, found here. This should allow you to troubleshoot why your device is not found. The process of discovering devices depends on mDns as found here in the docs. So there are several things to check in regards to making sure multicast packets are allowed on your network/device.
As a fallback I would also allow manual ip entry in case a user wasn't able to discover the device on their network, the google-tv-remote allows for this as well, I would take a look at that source to get an idea of how that applications handles different scenarios.
And as always, if it's not working, provide some examples of how you are trying to do the discovery as you haven't provided any information(source, logs, etc) for anyone to look at.
My experience with the sony google tv is that the multicast packets are reliably sent out shortly after the box is started. Paring at all other times is virtually impossible

App communication in nearby devices without user intervention

Is it possible to communicate two instances of an app:
In nearby devices (Android or iPhone)
Without user intervention (aside from starting the app once)
Without internet (but not network) connection?
How?
Android to Android?
iPhone to iPhone?
Android to iPhone and vice-versa?
Let us ignore the issues associated with implementing the network communication at the application level and focus on the system design problem your question raises.
You want an application on one device to connect to another associated application on another device without any user intervention/interaction beyond launching the device. In order for this to work your system is going to need a 3rd party separate from the two devices/applications that provides a lookup service.
What will need to happen is each application will need to communicate with this service, ask for the data regarding other device it should connect to, if it exists, and then attempt that connection. This is basically how a bittorrent tracker works.
Keep in mind that there's quite a bit more involved in the implementation than that simple scenario suggests. For example, the proper registering/unregistering of devices, registration timeouts, security, etc.
Unless I misunderstand your question, you should be able to just use standard sockets (TCP or UDP depending on your needs) for communication between any/all devices. For iPhone, you could probably use the NSStream classes and for Android you'd use the Socket classes.
Can the new NFC feature be an answer to this?

How do we detect if wifi becomes unavailable in iPhone SDK

Is there any way that we can programatically identify when the wifi of a user becomes available/unavailable?
My application requires exchanging messages between two different devices. It is working good in stable wifi setups. But if the wifi is unstable, I am having trouble in detecting if the other device is available or not.
I am not sure if this is expected, but my bonjour based NSNetService discoverer is not updating the available devices list automatically. This leaves me with a list of services that are not available for the exchange.
My line of thinking was to remove all the available services from the list and start a fresh search.
Please let me know if I am thinking in the right direction to solve the right problem.
Thanks in advance.
-Murali
Perhaps the Reachability sample code provided by Apple will help you in this regard. Although there have been people who say it hasn't been updated in a while, in which case, here is an actively maintained fork.
It seems like you can register for notifications so you can get frequent information on the state of the network.