Check if App has mobile data enabled (no wifi / mobile data is on)

Using the following plugins to check for internet access do not check that the app has mobile data enabled.

CrossConnectivity - jamesmontemagno
Reachability - Xamarin

Also calling a HttpWebRequest to google.com is allowed through even when the app has mobile data disabled

I have tried the following checks for the internet when only mobile data is enabled and the app has data usage turned off in the iOS settings:

                bool canRemoteReachGoogle = await CrossConnectivity.Current.IsRemoteReachable("www.google.com", 80, 5000);
                bool canReachGoogle = await CrossConnectivity.Current.IsReachable("google.com");
                bool isHostReachable = Reachability.IsHostReachable("http://google.com");

Answers

  • seanydaseanyda GBMember ✭✭✭✭✭

    Try putting the packages in your PCL project and your iOS project I had a similar problem.

Sign In or Register to comment.