ionic-team / ionic-framework

A powerful cross-platform UI toolkit for building native-quality iOS, Android, and Progressive Web Apps with HTML, CSS, and JavaScript.
https://ionicframework.com
MIT License
50.95k stars 13.51k forks source link

bug: Local Notification custom sound missing 'channel' for v26+.* #19696

Closed MInesGomes closed 4 years ago

MInesGomes commented 4 years ago

Bug Report

In Nogout the sound is playing. In Oero is not playing the custom sound, just the default sound. It is ignoring the sound

you can see here: https://distriqt.github.io/ANE-PushNotifications/m.FCM-GCM%20Payload

Sounds on individual notifications were deprecated in Android O (API 26). You now have to set them on a channel.

Is necessary the field channel for the sound to play :-)

Ionic version: [x] 4.9.1

Current behavior: Custom sound doesn't work for v26+.* Plays the normal sound.

Expected behavior: Play the sound that is in sound:

Steps to reproduce:

Schedule a local notification

Related code:

 this.localNot.schedule({
      id: id,
      // channel: id, // IS NOT Possible to set
      title: title,
      text: 'Some text',
      sound: `file://assets/audio/mySOUNDFILE.mp3`,
      icon: 'file://assets/img/logo/favicon.png', // TODO resident Img,
      color: colour
    });

Other information:

Ionic info:

Ionic:

   Ionic CLI                     : 5.4.4 (/usr/local/lib/node_modules/ionic)
   Ionic Framework               : @ionic/angular 4.9.1
   @angular-devkit/build-angular : 0.13.9
   @angular-devkit/schematics    : 7.3.9
   @angular/cli                  : 7.3.9
   @ionic/angular-toolkit        : 1.5.1

Cordova:

   Cordova CLI       : 9.0.0 (cordova-lib@9.0.1)
   Cordova Platforms : android 8.1.0, browser 5.0.4
   Cordova Plugins   : cordova-plugin-ionic-keyboard 2.2.0, cordova-plugin-ionic-webview 4.1.1, (and 11 other plugins)

Utility:

   cordova-res : 0.8.0 
   native-run  : 0.2.9 

System:

   Android SDK Tools : 26.1.1 (/Users/mirg/Library/Android/sdk)
   NodeJS            : v10.14.2 (/usr/local/bin/node)
   npm               : 6.4.1
   OS                : macOS Catalina
   Xcode             : Xcode 11.1 Build version 11A1027
liamdebeasi commented 4 years ago

Thanks for the issue. I am going to close this as Ionic Framework does not manage any local notification plugins. I recommend you post your question on our forum or our slack.

MInesGomes commented 4 years ago

@liamdebeasi Thank you for your reply. The forum has similar questions that is not working for level 26+, but has no reply.... Where can I post an issue that field "Channel" is missing in LocalNotifications ? To update the LocalNotifications wrapper ?

liamdebeasi commented 4 years ago

I would recommend looking at the GitHub repo for the local notifications plugin -- there may already be an issue open there.

ionitron-bot[bot] commented 4 years ago

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.