Open ghost opened 4 years ago
How is the token being fetched?
By FCM.getToken()
, you fetch the current native FCM token. Which might be null
if the app wasn't able to receive one from Google yet.
By FCM.onTokenRefresh()
, you listen to any changes to the current native FCM token. But if the current value doesn't change, you are not informed of anything, as there was no "FCM token refresh event".
Hello @andrehtissot
The token is retrieved by FCM.getToken ()
and as I mentioned through this function I get a valid token, I think the token would not be the problem since in IOS I hear the onNotification event perfectly, the problem is only in Android.
I also have the FCM.onTokenRefresh ()
listening, in case the token changes, but it never executes, although I think it is because the token never changes
i have same this issue in android
Got it... the issue is trying to send a data-only messages.
Unfortunately, there is no consistent way to have a data-only message working without writing the service in java yourself.
really the problem is that notifications are not received with the application in the foreground
@marwilc, your specific problem doesn't look related to @seguroapp's.
First of all my thanks for this great plugin.
I was updating the plugin in my application to version 7.3.1, and with this change the onNotification event is not being executed in my application.
The saddest thing now, not even going back to the previous version of the plugin which was version 6.4.3, it didn't work anymore.
I get to get the token in my application, and when I send the notification from my nodejs server with the following format:
I get a response from the sendToDevice method like the following:
Which makes me understand that everything is fine on the server side, which is logical since I have not touched anything.
I did a little test by switching to another plugin offered by ionic
Ionic Firebase-messaging and only by changing the interfaces, to said plugin, the onNotification was launched normally, which makes me understand that there is no problem in the APP logic or in the server.
On the server I use the firebase-admin version
"firebase-admin": "^ 9.1.0",
and then I expose my package.json of the APP.
To import the plugin I am doing the following
import {FCM} from 'cordova-plugin-fcm-with-dependency-updated/ionic/ngx';
Any help will be very welcome