Cordova-plugin-local-notifications: Can sound on local notification be desabled ?

Created on 20 Jun 2017  路  14Comments  路  Source: katzer/cordova-plugin-local-notifications

Your Environment

  • Plugin version: 0.8.4
  • Platform: Android
  • OS version: Kitkat
  • Device manufacturer / model: Redmi 2
  • Cordova version (cordova -v): 7.0.1
  • Cordova platform version (cordova platform ls):6.2.3
  • Plugin config
  • Ionic Version (if using Ionic) : 1

Expected Behavior

I'm using ionic1 i want make notification but sound and vivration be disabled

Actual Behavior

Notification sound and vibration cannot be disabled

Steps to Reproduce

i make sound be null

Context

I'm trying disabled sound and vibration but in my case if notification show sound and vribation still enable

Debug logs

Not available.

Awaiting Information No Template

Most helpful comment

I tried both sound: false and sound: null and neither seems to be working.
Any advice?

All 14 comments

please ignore the template because I don't have technical issue.

@RizkaOMG If it's not a technical issue then you wanna talk with a lawyer or football player instead about your issue? ;)

For example the answer may depend on the plugin version, the OS, the OS version, the cordova version, ...

I already change @katzer , what the problem in my issue

@RizkaOMG The sound is possible to disable, vibration not (yet). I am currently working on the next major release. Maybe that will be able to do at least for Android.

for both iOS and Android you can disable the sound via

cordova.plugins.notification.local.schedule({ sound: null, ... });

You have to correct java code.

in builder.java

fix like this

if (sound != null) {
 builder.setSound(sound);
}

=>

if (sound != null) {
            if(!sound.toString().equals(new String(""))){
                builder.setSound(sound);
            }
        }

Since v0.9-beta you can do:

cordova.plugins.notification.local.schedule({ sound: false, vibrate: false });

sound: null works for me in ionic 3

I tried both sound: false and sound: null and neither seems to be working.
Any advice?

same here, using cordova 8.1.2 with android and can't make it stop. tried null, false, nothing works.

Same here... Someone got the solution?

Same here.. I've tried empty string, null and false still the same..

working with:
"@angular/cdk": "^9.2.1"
"@ionic-native/core": "^5.23.0"
"@ionic/angular": "^5.0.7"
"cordova-android": "8.1.0"
"cordova-plugin-local-notification": "^0.9.0-beta.2",

Any update on this?

any updates?

This is not working. Any update please ?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

normanaranez picture normanaranez  路  3Comments

GitToTheHub picture GitToTheHub  路  4Comments

Kasendwa picture Kasendwa  路  3Comments

sharatchandra99 picture sharatchandra99  路  5Comments

daniele-sartiano picture daniele-sartiano  路  4Comments