I have been trying to integrate the transistorsoft background-fetch library without success: https://github.com/transistorsoft/react-native-background-fetch
When I chain any method to the BackgroundFetch component I get the error (attached in this post)
import BackgroundFetch from "react-native-background-fetch";
class TimerScreen extends React.Component {
...
componentDidMount() {
this.configureBackgroundFetch();
}
...
configureBackgroundFetch() {
// Configure BackgroundFetch.
BackgroundFetch.configure({
minimumFetchInterval: 15, // <-- minutes (15 is minimum allowed)
stopOnTerminate: false, // <-- Android-only,
startOnBoot: true, // <-- Android-only
enableHeadless: true
}, async () => {
console.log('BackgroundFetch has started');
BackgroundFetch.finish(BackgroundFetch.FETCH_RESULT_NEW_DATA);
}, (error) => {
console.log('RNBackgroundFetch failed to start')
});
}
...
I haven't been able to find out why the library isn't working. I have used react native link and installed it in package.json
...
{
...
"react-native-background-fetch": "^2.5.3",
...
}
...