Notification works perfectly. I have been facing an issue with tapping on the notification. After taping on the notification I get the payload data object in my app onNotificationOpen subscription only if the app is in memory.
I don't get the payload data while the app is not in memory. In other words, it does not work accordingly if the app is not in memory. This issue has been with the older version as well.
Is there any patch for this?
_I am using Firebase cloud messaging for this matter_
I'm currently working on a rewrite of the notifications functionality of this plugin which will address this issue in addition to fixing other existing issues and adding more features.
But I'll leave this issue open for now to capture the problem and when my new version is finished, it can be tested against this criteria.
BTW which platform are you seeing this issue on? iOS, Android or both?
In android. Not tested in iOS yet.
Thanks - I have observed the same issue in Android but also not tested this on iOS.
FYI this should be fixed on the dev branch if you want to give that a test.
I'm currently reworking the plugin on dev - when rework is completed, I'll merge to master and release a new major version.
I have tried with dev branch. It does not work accordingly. App loads when the app is not in memory while opening the app and can not find the payload data.
I am really looking forward to your new update for this plugin.
I've just published [email protected].
This is a major version that reworks the cloud messaging code and so will resolve this issue.
Please regression test using v5.0.0 of this plugin to confirm.
Note: v5.0.0 makes breaking changes to the plugin API - see the CHANGELOG for details.
You may find it useful to test using the example project which has a built-in FCM messaging client with test messages.
Fixed in v5.0.0
yup it is working just fine.
@dpa99c Please look into this. I am using the firebase cloud function to trigger the notification. I am using firebase-admin. The payload looks something like this.
const payloadMobile =
{
notification: {
title: title,
body: body,
icon: icon,
vibrate: '1',
color: "#f7066a",
sound: 'my_sound',
notification_android_sound: "my_sound",
},
data: {
patient_id: patient_id,
notification_type: notification_type,
title: title,
body: body,
payment_status: payment_status,
color: "#f7066a",
sound: 'my_sound',
notification_android_sound: "my_sound"
}
}
const responseMobile = await admin.messaging().sendToDevice(uniqueDevicesTokenArrayMobile, payloadMobile).
which works fine, I can get the notifications with custom color and custom icons. I am facing issues with the custom sound.
I also tried with the script as you have explained in the docs.
npm run send -- --message=android_notification.json --token="chLm2WNJcDY:APA91bFQxiTOg5aq8wJtVowkHyAIQXpzLYsuZdk00sl4D-iO5kmsuP0DcocEhDJe326d2PG9a0o1_0JQw3p0V2T9Iti5zRbukHNzmGCasxfA__XQd4g9qsxSZHrOKBasJ9qX39ZiA5ZO"
This also works fine except the sound property. Even if I remove the sound property also it gives me default sound here from script run.
<resource-file src="resources/android/raw/my_sound.mp3" target="app/src/main/res/raw/my_sound.mp3" />
this is also there in config.xml and does its job without any issue.
What might be the issue for which I can not make the custom ring tone work? From both firebase function and the sample .json files?
Platform - ionic 3, firebase-x 9.0.1(@latest)
why to open an issue rather fix here. any suggestions will help me a lot. Thanks.

Have you tried to reproduce this by building and running the example project app?
No, I have not tested the app. Let me check it. But if you guessed something for my issue then please suggest.
@dpa99c I have tried and it does not work with the example project project you have suggested. It only plays my default ringtone irrespective of what sound I am giving in the payload.
Please Watch this

While notification build I can see the sound is null. So it is not working.
@dpa99c does it still work for you? It is simply not working with the test app. Could you please check? Android version - 10
For Android 8.0 and above, it's the notification channel that defines the sound, not the sound key in the FCM message payload (see https://stackoverflow.com/a/54308706/777265)
I've updated the Android Notification Sound and Android Notification Channels sections of the documentation to make this clearer.