в ionic4 "BackgroundGeolocationConfig" удалить уведомление GPS отслеживания - PullRequest
0 голосов
/ 08 мая 2019

в ионном 4 https://ionicframework.com/docs/native/background-geolocation я реализовал это, все работает нормально, но уведомление "Я хочу удалить отслеживание GPS Enabaled", когда приложение выходит в фоновом режиме Изображение прикреплено пожалуйста, просмотрите please view

  const config: BackgroundGeolocationConfig = {
    desiredAccuracy: 10,
    stationaryRadius: 20,
    distanceFilter: 30,
    debug: true, //  enable this hear sounds for background-geolocation life-cycle.
    stopOnTerminate: false, // enable this to clear background location settings when the app terminates
    notificationsEnabled: true,
    // startForeground: true,
  };

  this.backgroundGeolocation.configure(config)
    .then((location: BackgroundGeolocationResponse) => {

      alert(location);
      // IMPORTANT:  You must execute the finish method here to inform the native plugin that you're finished,
      // and the background-task may be completed.  You must do this regardless if your HTTP request is successful or not.
      // IF YOU DON'T, ios will CRASH YOUR APP for spending too much time in the background.
      this.backgroundGeolocation.finish(); // FOR IOS ONLY

    });

  // start recording location
  this.backgroundGeolocation.start();

  // If you wish to turn OFF background-tracking, call the #stop method.
  this.backgroundGeolocation.stop();

1 Ответ

2 голосов
/ 08 мая 2019

попробуйте это в вашем

BackgroundGeolocation.config{
   notificationsEnabled: false,
}

Уведомление включено ложное скрывает ваше локальное уведомление.проверьте это также: https://github.com/mauron85/cordova-plugin-background-geolocation#configureoptions-success-fail

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...