首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在ionic4中"BackgroundGeolocationConfig“删除GPS追踪通知

在ionic4中"BackgroundGeolocationConfig“删除GPS追踪通知
EN

Stack Overflow用户
提问于 2019-05-08 12:14:11
回答 1查看 825关注 0票数 0

在离子4 https://ionicframework.com/docs/native/background-geolocation我实现了这一点,所有的工作都很好,但“我想删除全球定位系统跟踪启用”通知时,应用程序去背景图片附加的please view

代码语言:javascript
复制
  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();
EN

回答 1

Stack Overflow用户

发布于 2019-05-08 17:12:36

在你的

代码语言:javascript
复制
BackgroundGeolocation.config{
   notificationsEnabled: false,
}

notification enabled false将隐藏本地通知。也可以检查这个:https://github.com/mauron85/cordova-plugin-background-geolocation#configureoptions-success-fail

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/56033441

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档