Closed trackmyapp closed 3 years ago
Try using the FCM v1 API client in the example project to send messages using the Firebase Admin SDK to rule out any possible issue with your message structure.
If no notification is received on iOS when the app is in the background/not running then the problem is then likely to be your APNS configuration since no app code (including the plugin) is executed when a system notification is displayed until such time as the user taps it to trigger an app launch.
Thank you for the fast reply. I tried it again today without changing any code and now I'm receiving push notifications again in the example project. I close the issue.
@trackmyapp I was able to receive the notification but not able to catch any callback from message events. Are you able to catch message events? Btw, i'm using cordova.
@trackmyapp I was able to receive the notification but not able to catch any callback from message events. Are you able to catch message events? Btw, i'm using cordova.
Yes, I'm able to receive notifications and also catch the onMessageReceived callback. PS: Sorry for the late reply. Hope it still helps.
Hello there @dpa99c ,
I'm also facing issues with onMessageReceived in iOS. With Android is working flawless.
My current cordova-firebasex-plugin version is 13.0.0, and I don't have the cordova local notifications plugin installed in my project. I'm using instead capacitor's local notifications plugin.
I've also tried with latest cordova local notifications beta plugin that's supposed to work fine paired with this one, but I'm getting the same behavior.
I've tried to add breakpoints to the main notification handling functions in AppDelegate+FirebasePlugin.m
file, but it does not stop in any one.
I've also tried to make a new project from scratch with just firebasex and capacitor local notifications plugins, but it's still failing to display notificacions while iOS app is in foreground. The "onMessageReceived" method is never being called, I don't even have any error or warning in xcode log.
Background notifications are working fine, so any APNs problem can be discarded. The problem is just with foreground ones. OAUTH 2.0 Firebase notifications are also not working.
What could I have been missing?
Hello there @dpa99c ,
I'm also facing issues with onMessageReceived in iOS. With Android is working flawless.
My current cordova-firebasex-plugin version is 13.0.0, and I don't have the cordova local notifications plugin installed in my project. I'm using instead capacitor's local notifications plugin.
I've also tried with latest cordova local notifications beta plugin that's supposed to work fine paired with this one, but I'm getting the same behavior.
I've tried to add breakpoints to the main notification handling functions in
AppDelegate+FirebasePlugin.m
file, but it does not stop in any one.I've also tried to make a new project from scratch with just firebasex and capacitor local notifications plugins, but it's still failing to display notificacions while iOS app is in foreground. The "onMessageReceived" method is never being called, I don't even have any error or warning in xcode log.
Background notifications are working fine, so any APNs problem can be discarded. The problem is just with foreground ones. OAUTH 2.0 Firebase notifications are also not working.
What could I have been missing?
Hi @asimon91 Were you able to solve it? I'm facing the exact same issue with an Ionic / Cordova project. Everything works fine on Android, but only foreground notifications never make it to iOS, onMessageReceived callback don't get executed.
I'm using both cordova plugins, Firebase X and Local Notifications, is there any issue between those two?
Any help will be appreciated.
Bug report
CHECKLIST
[x] I have read the issue reporting guidelines
[x] I confirm this is a suspected bug or issue that will affect other users
[x] I have reproduced the issue using the example project
[x] I have read the documentation thoroughly and it does not help solve my issue.
[x] I have checked that no similar issues (open or closed) already exist. None of the issues mentioned that push notifications didn't work in the example project
Current behavior: Foreground and background notifications do not work on iOS. onMessageReceived() is not executed and no exception or error message is printed in Xcode. I've used the example project by only changing the package ID and overwriting the GoogleService-Info.plist file. After installing the example project the user gets asked to grant permission, the button "Get FCM token" works as expected.
What I tried and didn't work?
To send the notification I'm using postman with the following body:
{ "to": "device-Token-ID", "notification": { "body": "Notification body", "title": "New Message!" }, "data": { "notification_foreground": "true" } }
The notifications worked until 15.07.2020, but now it does not.
Expected behavior: onMessageReceived() should be executed, when receiving a push notification
Steps to reproduce: Environment information
Cordova CLI version
cordova -v
9.0.0 (cordova-lib@9.0.1)
Cordova platform version
cordova platform ls
Plugins & versions installed in project (including this plugin)
cordova plugin ls
Runtime issue
iOS build issue:
node -v
v10.15.3Related code:
Other information: I'm using Ionic 4.
Any help would be appreciated.