capacitor-plugins
capacitor-plugins copied to clipboard
@capacitor/network reports "connected" as true when the device is offline. It happens when there is a VPN client running.
Plugin(s)
@capacitor/network
Capacitor Version
Latest Dependencies:
@capacitor/cli: 5.5.1
@capacitor/core: 5.5.1
@capacitor/android: 5.5.1
@capacitor/ios: 5.5.1
Installed Dependencies:
@capacitor/cli: 5.5.0
@capacitor/core: 5.5.0
@capacitor/android: 5.5.0
@capacitor/ios: 5.5.0
Platform(s)
Android IOS
Current Behavior
We have a weird situation where, on Android, the getStatus()
method flip-flops between "connected=true" and "connected=false" randomly despite the device being completely offline (airplane mode). When it reports "connected=true" it states that the connection type is "unknown". It turns out that this is being caused by having a VPN client (in this case, NordLayer) installed and active. Although the device is offline, there is something about the VPN client that causes the plugin to think it is online - well it actually continuously toggles between online/offline.
Expected Behavior
Should not think its connected/online when it is not - even with a VPN client.
same
Hello, I have the same problem, did you manage to find a solution?
Also just noticed this issue. on capacitor 6.
@drakedeatonuk did you find any solution?
Unfortunately I did not @DanGosw 😞 I would've told you if I had.
@drakedeatonuk I found a possible solution, although very ugly, and it is to make requests from time to time to detect a connection, for example using axios,
axios.get(
https://pokeapi.co/api/v2/pokemon/)
and here I evaluate by the type of response that comes back to me, it may help you depending on your case
same, using tailscale for vpn :/ (only happening on android)
@karen1au Apparently this problem is in many other bookstores that offer the same thing :(
Is it possible to delay any display or alert by x amount of seconds until the VPN kicks in? Then subscribe to the observable.
Not sure what you mean by "VPN kicks in" in this scenario?