Skip to content

[firebase_messaging]: [iOS] FirebaseMessaging.onMessageOpenedApp.listen not called on click of new notification when the app is in background. The application was launched from terminated state via notification and moved to background. #18208

@wda3kor

Description

@wda3kor

Is there an existing issue for this?

  • I have searched the existing issues.

Are you aware of the differences between iOS and Android background message handling?

  • I understand that iOS and Android background messages behave differently, and I've designed my application with that in mind.

Do you have an active Apple Developer account?

  • I have an active Apple Developer account.

Are you using a physical iOS device to test background messages?

  • I am using a physical iOS device to test background messages.

Have you enabled "Remote Notifications" & "Background Mode" (Checking options for "Background Processing" & "Remote Notifications") in your app's Xcode project?

Image

Have you created an APNs key in your Apple Developer account & uploaded this APNs key to your Firebase console?

We are using APNS certificate instead of Key to trigger the notification. Our backend is directly sending the APNS push notification directly to APNS server.

Image

Have you disabled method swizzling for Firebase in your app?

Info.plist.zip

Are you sending messages to your app from the Firebase Admin SDK?

We are not using Firebase Admin SDK to send message to iOS (this we are using for Android)

Have you requested permission from the user to receive notifications?

  • I have the relevant permission to receive notifications.

Have you used the 'Console' application on your macOS device to check if the iOS device's system is throttling your background messages?

The FirebaseMessaging.onMessageOpenedApp.listen is not getting called.

Additional context and comments

FirebaseMessaging.onMessageOpenedApp.listen is never called on iOS when the user taps a push notification while the app is in the background, IF the app was originally launched from a terminated state by tapping a different notification.

The stream fires correctly the first time (terminated → background via notification tap → onMessageOpenedApp fires).
However, once the app is in background state after that flow, subsequent notification taps do NOT fire onMessageOpenedApp. The notification is delivered and the app comes to foreground, but the stream listener is never triggered.

getInitialMessage() also returns null in this scenario because the app was not newly launched — it was simply resumed from background.

Metadata

Metadata

Assignees

No one assigned

    Labels

    blocked: customer-responseWaiting for customer response, e.g. more information was requested.platform: iosIssues / PRs which are specifically for iOS.plugin: messagingtype: bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions