Problem with cordova-plugin-network-information

Now, I write code withe Network plugin and when I disconnected network in my device, i can´t see allert in console.

Show us your Code, is hard to help without

checkNetwork() {
let connectSubscription = => {
console.log(‘Estoy con internet’);

let disconnectSubscription = => {
  console.log('Estoy sin internet');


Srry. The problem is that i don´t now, where i should write there code, if in the constructor, ngOinit… Beause i want when press a button check if it have connection and when no connection active background mode.