Quantcast
Channel: Ionic Framework - Ionic Forum
Viewing all articles
Browse latest Browse all 49421

Use Ionic-Native network plugin in Ionic 1

$
0
0

@askullmania wrote:

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

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 49421

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>