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

🔥 [🐛] Bug Report Title - No task registered for key ReactNativeFirebaseMessagingHeadlessTask #7598

Closed
1 of 5 tasks
ricardojmf opened this issue Jan 30, 2024 · 20 comments
Labels
help: needs-triage Issue needs additional investigation/triaging. type: bug New bug report Type: Stale Issue has become stale - automatically added by Stale bot

Comments

@ricardojmf
Copy link

Issue

I'm currently using Expo v49 with firebase cloud messaging API V1 but can't put background push notifications working on the quitted state for Android.

We have two situations for setBackgroundMessageHandler to trigger on Android:

  • When the app is idle in the background. ✅
  • When the app is quitted. 🚫 .

The first one works properly, but the last one does not work. It gives me this error: No task registered for key ReactNativeFirebaseMessagingHeadlessTask

Can you help me please?


Project Files

Javascript

Click To Expand

_layout.tsx:

// Imports...

messaging().setBackgroundMessageHandler(async (remoteMessage) => {
    displayNotification(remoteMessage);
 });

export default function Root() {
  return (
    <FirstComponentToRender />
  );
}

Environment

Click To Expand

react-native info output:

 OUTPUT GOES HERE
  • Platform that you're experiencing the issue on:
    • iOS
    • Android
    • iOS but have not tested behavior on Android
    • Android but have not tested behavior on iOS
    • Both
  • `@react-native-firebase/messaging version you're using that has this issue:
    • 18.7.3
  • Are you using TypeScript?
    • Yes - 5.1.3


@ricardojmf ricardojmf added help: needs-triage Issue needs additional investigation/triaging. type: bug New bug report labels Jan 30, 2024
Copy link

Hello 👋, to help manage issues we automatically close stale issues.

This issue has been automatically marked as stale because it has not had activity for quite some time.Has this issue been fixed, or does it still require attention?

This issue will be closed in 15 days if no further activity occurs.

Thank you for your contributions.

@github-actions github-actions bot added the Type: Stale Issue has become stale - automatically added by Stale bot label Feb 27, 2024
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Mar 13, 2024
@ceyanesb
Copy link

I am having the same issue on android

@zairigimad
Copy link

i have same issue on android

@Protonosgit
Copy link

same

@mrcrg
Copy link

mrcrg commented Jun 14, 2024

Same

@Protonosgit
Copy link

Protonosgit commented Jun 14, 2024

I suspect that this has something to do with expo router and the startup sequence.
expo/expo#29757

Is anyone here also using the file based router of expo and has the issue?

@l3815
Copy link

l3815 commented Jun 17, 2024

same problem here.
[email protected]
[email protected]
├─ @react-native-firebase/[email protected]
├─ @react-native-firebase/[email protected]

function HeadlessCheck
({ isHeadless }) {
    if (isHeadless) {
        // App has been launched in the background by iOS, ignore
        return null;
    }

    // Render the app component on foreground launch
    return <RootLayout />;
}


// Register background handler
messaging().setBackgroundMessageHandler(async remoteMessage => {
    console.log(TAG, 'Message handled in the background!', remoteMessage);
});

registerRootComponent(HeadlessCheck)      
export default HeadlessCheck

Also do not work in Android quited app.

When fcm received: 
//  WARN  No task registered for key ReactNativeFirebaseMessagingHeadlessTask

It would be a big problem for us.

@pawel565
Copy link

same

1 similar comment
@guiathayde
Copy link

same

@firatbadur
Copy link

same problem flease fix this

@preethisun
Copy link

i am facing same issue.

@FernandoAOborges
Copy link

Has anyone fixed this error?

@ER-AdityaRawat
Copy link

Hello 👋, to help manage issues we automatically close stale issues.

This issue has been automatically marked as stale because it has not had activity for quite some time.Has this issue been fixed, or does it still require attention?

This issue will be closed in 15 days if no further activity occurs.

Thank you for your contributions.

it it still there

@ER-AdityaRawat
Copy link

Has anyone fixed this error?

hey you fixed this or not!!

@MohamedMegdich1
Copy link

same

@mitalpatelOG
Copy link

same issue

@FernandoAOborges
Copy link

For me, it only worked this way: only after I placed everything in the root of the app. If you put it inside a hook, you'll get this warning.

@Protonosgit
Copy link

For me, it only worked this way: only after I placed everything in the root of the app. If you put it inside a hook, you'll get this warning.

With or without expo file based routing?

@FernandoAOborges
Copy link

For me, it only worked this way: only after I placed everything in the root of the app. If you put it inside a hook, you'll get this warning.

With or without expo file based routing?

I've been using React Native for almost 7 years and have never used Expo.

@yossimenash-sf

This comment was marked as off-topic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help: needs-triage Issue needs additional investigation/triaging. type: bug New bug report Type: Stale Issue has become stale - automatically added by Stale bot
Projects
None yet
Development

No branches or pull requests