fechanique / cordova-plugin-fcm

Google FCM Push Notifications Cordova Plugin
623 stars 997 forks source link

Changing notification sound #189

Open spritus opened 7 years ago

spritus commented 7 years ago

Hi,

How can we change the notification sound in this plugin? I tried this code but there was no sound in this notification. This jingle file is in res/raw folder. Also, when I write other things in sound parameter, notification gives the default sound.

"notification":{ "title":"Test title", "body":"Test body ", "sound": "raw/jingle.mp3", "click_action":"FCM_PLUGIN_ACTIVITY" }, ...

Can you help me? Thanks.

marcoas commented 7 years ago
{
  ...,
  "sound": "nameFileWithoutExtension",
  ...
}

I use cordova and I have put my MP3 in %cordovaRootFolder%/Platforms/Android/res/raw

vargaendre commented 7 years ago

Hi, the way described by @marcoas works very well for Android, thank you. Although, where and how should I copy the sound file in case of iOS? I couldn't find any good documentation on this.

Radecom commented 5 years ago

I managed to put icon and custom sound by following this article. I'm working with Cordova plugin Fcm in Ionic 4 And so far everything is going well