question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Android disconnect() just returnstrue, but doesnt seem to disconnect from network?

See original GitHub issue
1.
 const disconnectFromNetwork = async (SSID: string) => {
            const currentSSID = await WifiManager.getCurrentWifiSSID();
            const isDisconnected = await WifiManager.isRemoveWifiNetwork(currentSSID);
            console.log({ currentSSID, isDisconnected });
        };
2.
   const disconnectFromNetwork = async (SSID: string) => {
            const isDisconnected = await WifiManager.disconnect();
            console.log({ isDisconnected });
        };

I’ve tried both of these, all I get is true, but the satellite icon is still on and it doesnt disconnect

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:9

github_iconTop GitHub Comments

1reaction
eliaslecomtecommented, Feb 10, 2021

If I have some time I’ll look into it. For Android, I would suggest using isRemoveWifiNetwork for now.

Questions:

  • Can you reproduce on multiple phones?
  • What phone model is used?
  • What Android OS is used?
  • Was the wifi network connected before via settings?

And also, in my experience, if you use the disconnect function, but there is no other wifi network arround, Android silently reconnect.

0reactions
LauraKlipfelcommented, Mar 4, 2021

Work for me to use isRemoveWifiNetwork() on Android. Thanks !

Read more comments on GitHub >

github_iconTop Results From Across the Web

NetworkInfo state for WIFI returns disconnected when no ...
I want to detect that Is Wifi connected to a network? Doesn't matter whether it has Internet connection or not.
Read more >
Wi-Fi Keeps Disconnecting on Android? 11 Ways to Fix
Wi-Fi Keeps Disconnecting on Android? 11 Ways to Fix · 1. Open the Settings app and tap Network & internet > Internet. ·...
Read more >
Connect to Wi-Fi networks on your Android device - Google Help
Disconnect Wi-Fi on your device · Open your device's Settings app. · Tap Network & internet and then Internet and then Wi-Fi. ·...
Read more >
ESP32 Reconnect to Wi-Fi After Lost Connection network
Reconnect your ESP32 to a Wi-Fi network after losing the connection. Reconnect when the ESP32 loses Wi-Fi signal, router restarts, or other situations....
Read more >
Bound services overview - Android Developers
A bound service is the server in a client-server interface. It allows components (such as activities) to bind to the service, send requests, ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found