Clarification on iOS/Android compatibility and future #2447
-
Hello, first of all thanks for your great work! I am also wondering how this all relates to the cross-device-sdk https://github.com/google/cross-device-sdk which has seen barely any development since its announcement on Google I/O 22 and has som similar objectives. It would be nice if you could provide some information, although I understand that you probably can not make any statements about Goolgle policies and/or product decisions. |
Beta Was this translation helpful? Give feedback.
Replies: 30 comments 3 replies
-
Hey @lschmierer Sorry for the confusion! Part of the reason we are deprecating Nearby Messages is to reduce some of the confusion between all of our offerings. This project should be able to cover most of the use cases of Nearby Messages. Nearby Connections operates on top of “mediums”. These mediums are used to discover other devices and transfer data. Each medium has its own advantages and limitations. Android has the largest list of supported mediums while iOS currently only has 1 supported medium (Wi-Fi LAN). Wi-Fi LAN’s limitation is that both devices need to be connected to the same Wi-Fi network to function. We are working on adding support for the BLE medium which would provide similar functionality as Nearby Messages for discovery and plan to have this ready before Nearby Messages is shut down (December 31st). Do you mind sharing documentation links that mention iOS not being supported so we can get those updated with more up-to-date information? As for the cross-device-sdk, it is intended to be easier to use than Nearby Connections, but has more restrictions (also, the cross-device-sdk does not have any iOS support yet) Hope this helps :) |
Beta Was this translation helpful? Give feedback.
-
Thanks for the quick response! Right on the landing page https://developers.google.com/nearby it says "The Nearby Connections API is available for Android" while "The Nearby Messages API is available for Android and iOS". This gives me the impression that Connections API is not available for iOS. On this site https://developers.google.com/nearby/overview it says explicitly at the bottom to use the Messages API if "you want to communicate between Android and iOS devices". I have only just realized that there is in fact Swift documentation once one is on the Connections documentation itself (https://developers.google.com/nearby/connections/overview) |
Beta Was this translation helpful? Give feedback.
-
Thanks! I’ll get those links updated :) |
Beta Was this translation helpful? Give feedback.
-
Just out or curiosity… I understand that there are fundamental limitations that make it impossible to establish P2P connections between Android and iOS without being connected to the same Wi-Fi AP. But would it in theory be possible to implement that direct communication for between two iOS devices? |
Beta Was this translation helpful? Give feedback.
-
Yes, we are actually experimenting with using the multipeer connectivity framework as a medium that would only be available between Apple devices, but it’s much lower priority than BLE at the moment |
Beta Was this translation helpful? Give feedback.
-
In the Apple world there is the feature of "sharing a WiFi password". If a user uses two Apple devices with the same iCloud account, e.g. iPhone and MacBook, the user can connect to a WiFi network for the first time and if the other device is nearby and already has the password stored it can share that password to the device connecting for the first time. Is this a feature which will also be provided by the Nearby API? I read a lot in the docs but couldn't find a clear indication of such a feature. I'm using Linux & Android and would love to see that feature! |
Beta Was this translation helpful? Give feedback.
-
Hi there. I have been exploring the Nearby Connections api and I am confused to whether discovering, connecting to and sharing data between android and iOS is possible or not. The Multidevice Development page:
While if we click on the same section, we are redirected to
Now it leaves me thinking if its really possible to achieve connection between android and ios devices. We did try building sample apps providing the same Strategy and Service ID but had no luck discovering android device from iOS or vice versa. Any help is appreciated. Thanks |
Beta Was this translation helpful? Give feedback.
-
https://stackoverflow.com/questions/77612062/google-nearby-connections-api-ios-android |
Beta Was this translation helpful? Give feedback.
-
Discovering / connecting / sharing data between iOS and Android is very possible and should work out of box as long as service IDs and strategy match and both devices are connected to the same Wi-Fi network. iOS doesn't support the full range of mediums that Android supports, so you may not be able to discover in certain scenarios. |
Beta Was this translation helpful? Give feedback.
-
Does this mean that we'll be able to transfer files between Android and iOS at WiFi speed(or close to it) using the multipeer connectivity framework, even when they are not in the same WiFi LAN? |
Beta Was this translation helpful? Give feedback.
-
Want to make sure I've understood this clearly, @bourdakos1 comments that Nearby Connections between iOS and Android are impossible offline, but the documentation for Nearby Connections open with:
My company is looking at building a solution that would allow a string to be sent from one react-native application to another at a point of sale and Nearby Connections appears to be the only way forward for something cross platform, but we cannot rely on devices being on the same network. Any comments or thoughts appreciated. |
Beta Was this translation helpful? Give feedback.
-
We are working on BLE support for iOS (#1619), which should allow for quickly sharing small strings while offline. |
Beta Was this translation helpful? Give feedback.
-
Hi, During implement Nearby Connection for Android and iOS. We have a situation in 2 different Wifi LAN:
Wifi LAN 2: Both Android and iOS are working well. Do you guys know any limitation of the network or restrict by it? Thanks! |
Beta Was this translation helpful? Give feedback.
-
Hi. Based on our experience: iOS <> Android can only communicate with each other if they are on the same WiFi and if mDNS is enabled on the network. For now, it seems to us that this library works fine between the same platform, but in all other cases there are hard constraints that are hard to meet in a real scenario. |
Beta Was this translation helpful? Give feedback.
-
Has anyone had success with Android <--> IOS connectivity via BLE? For example, by enabling BLE on IOS via the method suggested in #1619? |
Beta Was this translation helpful? Give feedback.
-
BLE support between Android/iOS is currently very limited, which is why it’s still flagged off. There are some GATT reading bugs on the iOS side which can cause discovery failures for an iOS device attempting to discover an Android device. There is also an MTU related bug that can make the connection timeout when trying to connect between Android/iOS. |
Beta Was this translation helpful? Give feedback.
-
I’m not aware of any network conditions that would cause iOS <> Android to fail, but continue to work iOS <> iOS. Could you provide some logs from both the iOS and Android side? |
Beta Was this translation helpful? Give feedback.
-
@bourdakos1 Actually Android and iOS can not discover each other in some WIFI LAN network. |
Beta Was this translation helpful? Give feedback.
-
@bourdakos1 you asked where there was outdated info. This video from 2022 says that nearby connections api is android only. I think I also saw a mention of android only in one of the docs as well. ill try to find it. im building a nearby dice rolling game so im still new to this stuff. hope to have ios <> android working! wonder if nearby can work with apples multipeer api too |
Beta Was this translation helpful? Give feedback.
-
nope. multipeer is ios only. so what he was saying was that multipeer would work as a medium only between apple devices |
Beta Was this translation helpful? Give feedback.
-
I suppose being on the same LAN != being online. So I guess that statement is true since I can have a local network that's not connected to the internet and ios and android would still work. But I agree the wording is confusing. maybe @bourdakos1 can update that text a bit. 😂 |
Beta Was this translation helpful? Give feedback.
-
Do you have logs from those failing devices + network you could share? Maybe it'd help identify the issue |
Beta Was this translation helpful? Give feedback.
-
That snippet was originally written for Android which supports fully offline transfers. iOS will technically support offline with BLE, but transfers will be very slow. Hotspot could eventually be used for faster offline transfers, but would provide a bit of a disruptive experience since it will show a system prompt when connecting and the user will lose connectivity for the duration of the transfer. We could also add WebRTC for when both devices are connected to separate networks. iOS<>Android fully offline seamless high speed transfers most likely won’t be possible unless Apple adds support for something like Wi-Fi Aware/Direct. I can try to get the snippet updated to be more clear. |
Beta Was this translation helpful? Give feedback.
-
aha! makes sense So if I have it right. on android it can be fully offline (through wifi direct) but with ios (since it doesn't support wifi direct and instead has its own thing called AWDL) it can't be fully offline. what about my minor asterik I mentioned above. Can I technically have a local wifi network without internet access, and android to ios should still work right? even though it techncially isn't connected to the "internet"? |
Beta Was this translation helpful? Give feedback.
-
Yea I think that should work. You should also be able to use Wi-Fi LAN if one of the devices sets up a personal hotspot and both connect to it. |
Beta Was this translation helpful? Give feedback.
-
FWIW, I moved onto another company and funny enough they wanted me to work on multi device comms again. I suggested google nearby and they brought up that it's not multiplatform according to the docs "Our Nearby platform contains This is the same screenshot I added above a while back. Maybe best to update that? https://developer.android.com/multi-device-development |
Beta Was this translation helpful? Give feedback.
-
Thanks! I’ll try to get that updated |
Beta Was this translation helpful? Give feedback.
-
Hey @bourdakos1! I understand that offline communication between iOS and Android is still not possible. Does Nearby Connections support offline communication between Android and Android, as well as between iOS and iOS? If so, which medium does it use for iOS to iOS communication? |
Beta Was this translation helpful? Give feedback.
-
@bourdakos1 Reading through the whole thread, and some of the comments in here, I'm not sure if the Nearby Messages API would still work today? As in, for a Greenfield project. The documentation warns that the Nearby Messages API was deprecated in December, 2023? How are people still using it then? We are also interested in using the Nearby API, but we're a React Native app, and the only libraries found thus far are for the Nearby Messages API. Could you please give your thoughts on this? |
Beta Was this translation helpful? Give feedback.
Hey @lschmierer
Sorry for the confusion! Part of the reason we are deprecating Nearby Messages is to reduce some of the confusion between all of our offerings. This project should be able to cover most of the use cases of Nearby Messages.
Nearby Connections operates on top of “mediums”. These mediums are used to discover other devices and transfer data. Each medium has its own advantages and limitations. Android has the largest list of supported mediums while iOS currently only has 1 supported medium (Wi-Fi LAN). Wi-Fi LAN’s limitation is that both devices need to be connected to the same Wi-Fi network to function.
We are working on adding support for the BLE medium which would provide si…