Hello,
I've a problem with the plugin Connectivity. When I start my app I've this mistake :
This functionality is not implemented in the portable version of this assembly. You should reference the NuGet package from your main application project in order to reference the platform-specific implementation.
On this line :
CrossConnectivity.Current.ConnectivityChanged += Current_ConnectivityChanged;
This is my code :
using Xamarin.Forms;
using Plugin.Connectivity;
namespace CMore
{
public partial class CMorePage : ContentPage
{
public CMorePage()
{
InitializeComponent();
CrossConnectivity.Current.ConnectivityChanged += Current_ConnectivityChanged;
}
private async void Current_ConnectivityChanged(object sender, Plugin.Connectivity.Abstractions.ConnectivityChangedEventArgs e)
{
if (!e.IsConnected)
{
await DisplayAlert("Erreur", "Vérifier votre connexion internet!", "OK");
}
else
{
loadingData.IsRunning = false;
loadingData.IsVisible = false;
await Navigation.PushAsync(new MapPage());
}
}
protected async override void OnAppearing()
{
base.OnAppearing();
if (!CrossConnectivity.Current.IsConnected)
{
await DisplayAlert("Erreur", "Vérifier votre connexion internet!", "OK");
}
}
}
}
Please help me
Thanks