fluttercommunity / plus_plugins

Flutter Community Plus Plugins
BSD 3-Clause "New" or "Revised" License
1.61k stars 972 forks source link

[Question]: connectivity_plus do not respond to Bluetooth switching in IOS #2767

Closed Silverviql closed 7 months ago

Silverviql commented 7 months ago

What is your question?

I see a change in wifi status, but the bluetooth status does not work

I check on a physical device via usb iPhone 12 version ios: 16.6.1

Checklist before submitting a question

miquelbeltran commented 7 months ago

You'll have to provide more information.

Silverviql commented 7 months ago

@miquelbeltran

  1. I turn Bluetooth on and off on my phone through the curtain, there are a lot of tasks
  2. Example code this porject in git
  3. What to return information ConnectionResult.bluetooth after off/on Bluetooth
  4. The plugin responds to turning wifi on or off in the curtain for many tasks. But bluetooth does not respond to changes in state
  5. Last version i am test and my project and I tried running the example project. The result is the same

https://github.com/fluttercommunity/plus_plugins/assets/23103415/e9f69fb1-348c-4a5e-b500-a67161ea2539

miquelbeltran commented 7 months ago

Hi, I think there's some confusion here.

The plugin provides information about internet/network connectivity using iOS NWPathMonitor.

The possible values NWPathMonitor can provide are:

case wifi The network interface type used for communication over Wi-Fi networks. case cellular The network interface type used for communication over cellular networks. case wiredEthernet The network interface type used for communication over wired Ethernet networks. case loopback The network interface type used for communication over local loopback networks. case other The network interface type used for communication over virtual networks or networks of unknown types.

Which does not include bluetooth.

The only case where Bluetooth connectivity can be reported by the plugin is when using it in a Linux desktop app, as is the only implementation that supports reading Bluetooth network connectivity devices.

I think this answers the question you have. Let me know if you need further clarification.

edit: update on bluetooth support on ios

Silverviql commented 7 months ago

@miquelbeltran But I didn't find in doc who ConnectivityResult.bluetooth anywhere for Linux only.

miquelbeltran commented 7 months ago

That's fair, I think we should document which cases can be supported on each platform because it is inconsistent, as it depends on what the platform offers.

miquelbeltran commented 7 months ago

Created a ticket for that: https://github.com/fluttercommunity/plus_plugins/issues/2776

Silverviql commented 7 months ago

@miquelbeltran in package flutter_blue_plus it is possible to monitor the status of bluetooth. Maybe in the future such functionality will appear in your plugin