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

Error: Failed to call into JavaScript module method AppRegistry.startHeadlessTask() #8199

Closed
alized559 opened this issue Dec 20, 2024 · 2 comments
Labels

Comments

@alized559
Copy link

alized559 commented Dec 20, 2024

I am getting this error when sending notification and app is in background. Note that I am receiving the noc correctly while the app is opened.

I added the google-services.json and edited AndroidManifest and build.gradle but still facing the issue.

The error:
(NOBRIDGE) ERROR Error: Failed to call into JavaScript module method AppRegistry.startHeadlessTask(). Module has not been registered as callable. Registered callable JavaScript modules (n = 9): GlobalPerformanceLogger, RCTNativeAppEventEmitter, RCTEventEmitter, SamplingProfiler, RCTDeviceEventEmitter, HMRClient, RCTLog, HeapCapture, Systrace. Did you forget to call registerCallableModule?

index.js:
/**

import {AppRegistry} from 'react-native';
import App from './App';
import {name as appName} from './app.json';
import messaging from '@react-native-firebase/messaging';

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

AppRegistry.registerComponent(appName, () => App);

packages:
"react-native": "0.76.0",
"@react-native-firebase/app": "^21.6.1",
"@react-native-firebase/messaging": "^21.6.1",

@mikehardy
Copy link
Collaborator

Please try again with a new issue where you do not delete the issue template, rather, you fill in the template with the requested information

@mikehardy
Copy link
Collaborator

Also headlessJS had issues until the most recent release, plus upgrade to react-native 0.76.5

"react-native": "0.76.0",

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants