Use Ionic-Native network plugin in Ionic 1


#1

I have replaced ng-crodova with ionic- native in my Ionic v1 app. How i can listen to the network online and offline events in an Ionic v1 app. The docs only has the ionic 2 way

let disconnectSubscription = Network.onDisconnect().subscribe(() => {
    console.log('network was disconnected :-(');
 });

 // stop disconnect watch
  disconnectSubscription.unsubscribe();

I tried the old ng-crodova way, but it doesn’t seem to work in ionic-native
$rootScope.$on('$cordovaNetwork:offline', function(event, networkState)

Hope someone could help convert the above ionic 2 code to ionic1,

Thanks