enter image description here我正在使用xamarin表格。我需要检查我的应用是否拥有移动数据(不是互联网访问)的许可。我无法获得任何代码。
请参考下面的图片.enter image description here
您可以使用Xamarin.Essentials检查设备连接
您将以这种方式使用API:
var current = Connectivity.NetworkAccess;
if (current == NetworkAccess.Internet)
{
// Connection to internet is available
}
else
{
//Connection to internet is not available because mobile data is disable
}