Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 58056

INetwork IsReachable always returns false

$
0
0

I'm calling Xamarin.Forms.Labs.Droid.Services.Network's IsReachable() and IsReachableByWifi(), to check connectivity and access to a server prior to an action such as login. These methods always return false, when called with any host i.e an internal address 192.168.... (where calls to its apis succeed within the app just fine), and external https:// sites and even google.com.. According to some posts on here, the host string must not have http://... When I use await with IsReachable, i.e ..
await network.IsReachableByWifi("www.google.com", TimeSpan.FromSeconds(10));
I can never get past this line as a breakpoint.

I also tried using the code from https://github.com/XLabs/Xamarin-Forms-Labs/blob/d69abd3b66c41348216f8698d6e45457cf1c7ef3/src/Xamarin.Forms.Labs/Xamarin.Forms.Labs.Droid/Services/Network.cs as an implementation of INetwork. Here, the methods just return false no matter what.

Is anyone able to point me in the right direction as to why this would be happening or what I'm doing wrong? Thank you


Viewing all articles
Browse latest Browse all 58056

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>