Giter Site home page Giter Site logo

Comments (15)

dpa99c avatar dpa99c commented on August 16, 2024 1

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.

from cordova-plugin-firebasex.

dpa99c avatar dpa99c commented on August 16, 2024 1

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.

from cordova-plugin-firebasex.

dpa99c avatar dpa99c commented on August 16, 2024 1

Fixed in v5.0.0

from cordova-plugin-firebasex.

dpa99c avatar dpa99c commented on August 16, 2024

BTW which platform are you seeing this issue on? iOS, Android or both?

from cordova-plugin-firebasex.

sibabratswain11 avatar sibabratswain11 commented on August 16, 2024

In android. Not tested in iOS yet.

from cordova-plugin-firebasex.

dpa99c avatar dpa99c commented on August 16, 2024

Thanks - I have observed the same issue in Android but also not tested this on iOS.

from cordova-plugin-firebasex.

sibabratswain11 avatar sibabratswain11 commented on August 16, 2024

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.

from cordova-plugin-firebasex.

dpa99c avatar dpa99c commented on August 16, 2024

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.

from cordova-plugin-firebasex.

sibabratswain11 avatar sibabratswain11 commented on August 16, 2024

yup it is working just fine.

from cordova-plugin-firebasex.

sibabratswain11 avatar sibabratswain11 commented on August 16, 2024

@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.

Screenshot 2020-03-18 at 12 47 23 AM

from cordova-plugin-firebasex.

dpa99c avatar dpa99c commented on August 16, 2024

Have you tried to reproduce this by building and running the example project app?

from cordova-plugin-firebasex.

sibabratswain11 avatar sibabratswain11 commented on August 16, 2024

No, I have not tested the app. Let me check it. But if you guessed something for my issue then please suggest.

from cordova-plugin-firebasex.

sibabratswain11 avatar sibabratswain11 commented on August 16, 2024

@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

IMG_20200318_122600
While notification build I can see the sound is null. So it is not working.

from cordova-plugin-firebasex.

sibabratswain11 avatar sibabratswain11 commented on August 16, 2024

@dpa99c does it still work for you? It is simply not working with the test app. Could you please check? Android version - 10

from cordova-plugin-firebasex.

dpa99c avatar dpa99c commented on August 16, 2024

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.

from cordova-plugin-firebasex.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.