Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[firebase_messaging]: FirebaseMessaging.onMessageOpenedApp not working in iOS after upgrade to 15.2.2 #17103

Closed
1 task done
lukyanov opened this issue Feb 17, 2025 · 3 comments
Labels
Needs Attention This issue needs maintainer attention. platform: ios Issues / PRs which are specifically for iOS. plugin: messaging resolution: wontfix This will not be worked on type: bug Something isn't working

Comments

@lukyanov
Copy link

Is there an existing issue for this?

  • I have searched the existing issues.

Which plugins are affected?

Messaging

Which platforms are affected?

iOS

Description

@override
void initState() {
    super.initState();
    WidgetsBinding.instance.addObserver(this);
    FirebaseMessaging.onMessageOpenedApp.listen((RemoteMessage message) {
      logger.d("A new onMessageOpenedApp event was published!");
      // some useful logic here
    });
}

onMessageOpenedApp is not triggered when the app is opened from the "killed" state. It works when the app is in the background though.

The plugin version 15.1.6 (the previous version I used) works perfectly, as expected, in both cases.

iOS 18.3.1

Reproducing the issue

  1. Close the app (swipe it away)
  2. Send a notification via firebase console or with a script (in my case I have a link attached to the notification data)
  3. Tap the notification

FirebaseMessaging.onMessageOpenedApp is not triggered.

Firebase Core version

3.11.0

Flutter Version

3.27.2

Relevant Log Output

Flutter dependencies

No response

Additional context and comments

No response

@lukyanov lukyanov added Needs Attention This issue needs maintainer attention. type: bug Something isn't working labels Feb 17, 2025
@SelaseKay SelaseKay added plugin: messaging platform: ios Issues / PRs which are specifically for iOS. labels Feb 17, 2025
@SelaseKay
Copy link
Contributor

Hi @lukyanov, the behaviour you're experiencing is intended. onMessageOpenedApp is only triggered when app is opened from a background state(not terminated) as indicated here.

@SelaseKay SelaseKay added the resolution: wontfix This will not be worked on label Feb 17, 2025
@lukyanov
Copy link
Author

@SelaseKay I'm sorry, I explain myself in a wrong way. I actually meant await FirebaseMessaging.instance.getInitialMessage() which is always empty in the newer version of the plugin. I'll rewrite the description.

@lukyanov
Copy link
Author

#17107

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Attention This issue needs maintainer attention. platform: ios Issues / PRs which are specifically for iOS. plugin: messaging resolution: wontfix This will not be worked on type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants