Skip to content

feat(ios): On Notification Tap events not passed to firebase handlers that handles the notifications that opened the app #23

@rutvik110

Description

@rutvik110

Description :

I'm working on adding foreground and background notifications support in one of my apps. I've got firebase and pusher beams added to support notifications.
As of this moment, as pusher beams only has handlers to handle notifications in foreground state with PusherBeams.instance.onMessageReceivedInTheForeground and no support for handling notifications that are opened the app from background or terminated state, so to handle those types of events, I'm using Firebase handler FirebaseMessaging.onMessageOpenedApp.listen to listen to those notifications.

The issue comes when I'm trying to open the app from background/terminated state by tapping on notifications on ios, the firebase handler is never called.

Warning: Application delegate received call to -application:didReceiveRemoteNotification:fetchCompletionHandler: but the completion handler was never called and the following warnings are logged in the console.
Warning: UNUserNotificationCenter delegate received call to -userNotificationCenter:didReceiveNotificationResponse:withCompletionHandler: but the completion handler was never called.

In case of android, the handler does gets called properly and I recieve that notification data within the app.

To make sure this wasn't an issue around firebase handlers, I removed all the pusher beams integration and tested the notifications which worked as expected in all app states.
I did a little digging in to the pusher beams ios code for notifications, found out this handler here for handling notification taps.
Screenshot 2022-03-22 at 9 09 07 AM

I see that it's yet to be implemented but I still don't understand the reason why the background notifications are properly passed on to the firebase handlers in the android but on ios it fails to do so. Is pusher beams handling that callback but not passing it to firebase handlers!?
Could really use some help here as this is a critical part of our app!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions