cordova-plugin-background-geolocation: notificationsEnabled false is not working

  • Plugin version: 3.0.0-alpha.45
  • Platform: Android
  • OS version: 9.0
  • Device manufacturer and model:
  • Running in Simulator: yes
  • Cordova version (cordova -v): 8.1.2 (cordova-lib@8.1.1)
  • Cordova platform version (cordova platform ls): android 7.1.4
  • Plugin configuration options: locationProvider: window.BackgroundGeolocation.DISTANCE_FILTER_PROVIDER, desiredAccuracy: window.BackgroundGeolocation.MEDIUM_ACCURACY, stationaryRadius: 1, debug: false, distanceFilter: 1, stopOnTerminate: false, startOnBoot: true, startForeground: true, notificationsEnabled: false, notificationTitle: “test title”, notificationText: “test text”, notificationIconColor: “#f21e54”, activityType: ‘OtherNavigation’, pauseLocationUpdates: false, saveBatteryOnBackground: true, stopOnStillActivity: false, url: “MY_URL” httpHeaders: { ‘MY_HEADER’: ‘VALUE’ }, maxLocations: 1, postTemplate: { latitude: ‘@latitude’, longitude: ‘@longitude’ }

Context

when i set “notificationsEnabled” to false (notificationsEnabled: false) the notification is still visible

Expected Behavior

hidden local notifications

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 25 (4 by maintainers)

Most upvoted comments

@mauron85 Thanks! I see 😦 So we have to live with the notification because we need a foreground service, otherwise the background service will be killed. It makes sense, thanks for your work, it’s great to see that this plugin is actively maintained 😃

@mauron85 Thanks for quick response. I know that, but for me who uses also cordova-background-mode by katzer, no need to be displayed second notification. So this option notificationsEnabled: false could be right fit to my goal. In current version of your plugin this option is not working. Or then I don’t understand why this option needed?

@mauron85 Hi ! A few days ago I saw in a .java file (I do not know which one) that there was a function

notificationIsEnable { return notificationEnable! == null }

Whether it is false or true, this test always returns true and will activate the notification. Can the problem come from this test?