/// <summary>
        /// Received a notification via BR.
        /// </summary>
        /// <param name="context"></param>
        /// <param name="intent"></param>
        public override async void OnReceive(Context context, Intent intent)
        {
            if (intent.Action != ConnectivityManager.ConnectivityAction)
            {
                return;
            }

            //await 500ms to ensure that the the connection manager updates
            await Task.Delay(500);

            var newConnection = IsConnected;

            if (newConnection != _isConnected)
            {
                _isConnected = newConnection;

                ConnectivityChanged?.Invoke(this, new ConnectivityChangedEventArgs(_isConnected));
            }


            var connectionTypes = ConnectivityService.GetConnectionTypes(ConnectivityManager);

            ConnectivityTypeChanged?.Invoke(this, new ConnectivityTypeChangedEventArgs(newConnection, connectionTypes));
        }
 public ConnectivityChangeBroadcastReceiver(ConnectivityService service)
 {
     ConnectivityService = service;
     _isConnected        = IsConnected;
 }