import { Injectable } from '@angular/core';
import { BehaviorSubject, Observable } from 'rxjs'
import { Platform } from '@ionic/angular'
import { Network } from '@capacitor/network';

@Injectable({
  providedIn: 'root'
})

export class NetworkConnectionService {
  online: boolean = true;

  constructor(){
    Network.addListener('networkStatusChange', status => {
      console.log('Network status changed', status);
    });
  }
  

  
   logCurrentNetworkStatus = async () => {
    const status = await Network.getStatus();

    return status;
  
  };

}