EddyVerbruggen / nativescript-plugin-firebase

:fire: NativeScript plugin for Firebase
https://firebase.google.com
MIT License
1.01k stars 441 forks source link

onMessageReceivedCallback never fired #1761

Open oliverphaser opened 3 years ago

oliverphaser commented 3 years ago

Hi,

I'm using NS 7.1.2 with plugin 11.1.3. The onMessageReceivedCallback never fired in any of my apps. I'm receiving the token and I got the push notification on the device, but I never see the onMessageReceivedCallback function result in the console. I tried even in Xcode, but it isn't working. Prior to the upgrade of NS 7, I was always seeing the result of the onMessageReceivedCallback. Now nothing happening. If I revert back to NS6 with plugin 10.5.2 then it works. Any idea?

bmacdonald commented 3 years ago

I am running into a similar problem. I've confirmed this in both my production application and a simple template application from scratch. If you have the application open and receive a notification, the onMessageReceivedCallback is never called. For me, this is happening because the application is crashing.

However, if the app is closed, I can still receive notifications. The crash only happens when the app is open.

NS: 7.1.2 Plugin: 11.1.3 iOS: 14.3

oliverphaser commented 3 years ago

I didn't received anything if the app was in foreground. I tried most of the methods which I found here and other places in Google but no success. Now I'm on NS6 with 10.5.2, but it is only working if the app started first. If I close then open it stops again. If I delete the app then build again then it will work until I close. I uploaded to TestFlight but there isn't working at all. On the device isn't show even if the app is closed/minimized.

StefanNedelchev commented 3 years ago

I'm not sure if that's the exact same issue that I used to have but it's worth trying. I had similar issue and I thought that the event was firing but after further debugging I realised that it works just fine and the problem was in the implementation. Just make sure to use the loaded event of your main page and then attach the listener for onMessageReceivedCallback

nuno-morais commented 3 years ago

I've the same issue. Messaging is not working at all in iOS