react-native-firebase icon indicating copy to clipboard operation
react-native-firebase copied to clipboard

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

Open ricardojmf opened this issue 2 years ago • 0 comments

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
    • [x] 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 avatar Jan 30 '24 14:01 ricardojmf