title: Background mode on capacitor does not work properly
body: <p>I'm trying to display a notification when the app is in the background and the internet connection has changed. When I have the app open everything works fine, but when I have the app closed (in the background) nothing happens</p>
  <pre><code>import { Platform } from '@ionic/angular';
  import { BaseServiceService } from './../services/base-service/base-service.service';
  import { LocalNotifications, LocalNotificationSchema } from '@capacitor/local-notifications';
  import { Component, OnInit } from '@angular/core';
  import { BackgroundMode } from '@ionic-native/background-mode/ngx';
  
  @Component({
    selector: 'app-home',
    templateUrl: 'home.page.html',
    styleUrls: ['home.page.scss'],
  })
  
  export class HomePage implements OnInit {
  
  notificationsDelayInSeconds = '';
  
  constructor(private backgroundMode: BackgroundMode,
    public baseService: BaseServiceService,
    private platform: Platform) {
    platform.ready().then(() =&gt; {
      backgroundMode.enable();
      backgroundMode.on('activate').subscribe(() =&gt; {
        window.addEventListener('offline', () =&gt; {
          this.baseService.scheduleNotification();
        });
      });
    });
   }
  }
  </code></pre>