alexkendall / react-native-bluetooth-cross-platform

Cross-Platform Bluetooth & WiFi React Native Module. Powered by underdark http://underdark.io/.
179 stars 35 forks source link

iOS devices only detecting one nearby peer at a time #32

Closed azanli closed 6 years ago

azanli commented 6 years ago

This issue is happening on iOS devices. Android is able to list every nearby peer that is broadcasting. The scenario is I have 3 iOS devices and an Android. The Android lists every one of them but each iOS device only lists one other device that it has detected. I was able to confirm this by turning off one of the iOS devices and what happened was that the other device which had originally detected it, lost connection to it and immediately detected a different iOS device which was still broadcasting.

Is this a known issue or is there some permission within Xcode that is preventing multiple detection/connections to be made?

virl commented 6 years ago

Bluetooth on iOS 11 currently doesn't work due to iOS 11 bug. Working to fix that.

azanli commented 6 years ago

I noticed that issue on your Cocoa branch. But the thing is, this is "WIFI-BT" mode. The devices are able to detect each other and send messages via WIFI including iOS devices, but the only problem is the iOS devices can only detect one peer until that peer stops broadcasting and only then can it detect a different peer. This makes it very difficult to select the right device to connect with when there are multiple devices in the room. Does this kind of occurrence happen with a native build as well? @virl

virl commented 6 years ago

@Progoogler No, I haven't seen such behaviour in native version.

azanli commented 6 years ago

This was a problem on the React Native side, you're right to not have seen it. Thank you for your response! @virl

wswoodruff commented 6 years ago

@Progoogler What was the fix? And what version of react-native are you using?

azanli commented 6 years ago

@wswoodruff RN: v.49.5

The fix is in the new PR. It just stops the loop from returning before it gets a chance to add the new user.