Closed hembachrterran closed 2 years ago
This issue may need more information before it can be addressed. In particular, it will need a reliable Code Reproduction that demonstrates the issue.
Please see the Contributing Guide for how to create a Code Reproduction.
Thanks! Ionitron 💙
@josprimasihombing Yes, same here. @jcesarmobile The example code needs to set up Firebase as @josprimasihombing wrote, thats why I linked the example, I used the same code.
I can switch the configuration files to use my own once you provide the sample app, but without a sample app this can’t be reproduced, you probably missed some step.
Okay, I will provide it soon.
I've got the same issue, pushNotificationActionPerformed
in my case.
I'm still not certain about it, but It seems like this event is not triggering if the app is in a sleep state in the background. It does not occur directly after we move the app to the background, but after iOS has truncated memory (or put the app in a sleep state?).
I made a sample application, the plugin work as expected, if the app is running in foregroung, it triggered the pushNotificationActionPerformed. I have been skipped one step on Apple website with the signatures, the https://capacitorjs.com/docs/guides/push-notifications-firebase documentation is not as detailed as has to be in my opinion.
@josprimasihombing When you create certifications in Developer https://developer.apple.com/account/resources/certificates/list, you have to set up an Identifier before: https://developer.apple.com/account/resources/identifiers/list. There you have to allow the PushNotification service Capability, after you created it, you can select it from the list to edit. There will be a Configure button where you can create a Development SSL Certificate or Production SSL Certificate. In next step you have to upload a Certificate Signing Request from your Mac. Hard to notice but above the input, there is a learn more link: https://help.apple.com/developer-account/#/devbfa00fef7 Following this documentation you can create the signing request on your local computer then upload and save the capability certification on Apple website.
@jcesarmobile I find out the differences. In the application I want to use this plugin also we use the "https://ionicframework.com/docs/native/background-geolocation" plugin. It seem the background geolocation plugin is incompatible with this push notification plugin. I have no more detail what part of the plugin caused the problem, but 100% sure this is why pushNotificationReceived and pushNotificationActionPerformed events has not been triggered, after uninstall the background geolocation plugin the events fires properly.
That plugin has its own UNUserNotificationCenterDelegate, that's what handles the notifications and apps can only have one, so when you install that plugin it sets itself as the notifications delegate and the events don't get propagated to Capacitor push/local-notification plugins.
It would be nice if mention this in the documentations.
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of the plugin, please create a new issue and ensure the template is fully filled out.
Bug Report
Plugin(s)
@capacitor/push-notifications
Capacitor Version
Platform(s)
[x] iOS
Current Behavior
I followed this https://capacitorjs.com/docs/guides/push-notifications-firebase documentation, I would like to use this plugin with FCM. The PushNotifications.register() called properly and "registration" listener is triggered, returned a token. By the token the test message arrive to the phone and show a notification with the proper title and body, but the "pushNotificationReceived " listener and after click on the notification the "pushNotificationActionPerformed" doesn't fire. I tried everything to figure out what's the problem, but I have no clue. In the listeners there is only a console log, I copy and paste the code from the example.
Expected Behavior
The listeners print to the console, the notification data.
Code Reproduction
The code is presented in the example of the following link: https://capacitorjs.com/docs/guides/push-notifications-firebase
Other Technical Details
XCode 13.2.1 The phone is an iPhone 11 with latest updates. The Push Notification capability is enabled.
Additional Context
This problems seems related with https://github.com/ionic-team/capacitor-plugins/issues/200