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.instance.getInitialMessage() is always null on iOS after upgrade to 15.2.2 #17107

Open
1 task done
lukyanov opened this issue Feb 17, 2025 · 1 comment
Labels
blocked: customer-response Waiting for customer response, e.g. more information was requested. platform: ios Issues / PRs which are specifically for iOS. plugin: messaging 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

await FirebaseMessaging.instance.getInitialMessage() is always null when the app is opened from the "killed" state.

The plugin version 15.1.6 (the previous version I used) worked as expected.

iOS 18.3.1

@pragma('vm:entry-point')
Future<void> _firebaseMessagingBackgroundHandler(RemoteMessage message) async {
  await Firebase.initializeApp();
  RemoteMessage? initialMessage = await FirebaseMessaging.instance.getInitialMessage()
  // initialMessage is always null here
}

void main() async {
  FirebaseMessaging.onBackgroundMessage(_firebaseMessagingBackgroundHandler);
  ...
}

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
  4. Observe initialMessage being null

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, I've been able to reproduce this issue with the firebase_messaging example app. As a workaround, add a delay of 3 seconds before calling getInitialMessage and see if it resolves your issue.

@SelaseKay SelaseKay added blocked: customer-response Waiting for customer response, e.g. more information was requested. and removed Needs Attention This issue needs maintainer attention. labels Feb 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked: customer-response Waiting for customer response, e.g. more information was requested. platform: ios Issues / PRs which are specifically for iOS. plugin: messaging type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants