You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using the latest "react-native-background-actions": "^4.0.1", trying to understand why am I getting null when I do await BackgroundService.start(veryIntensiveTask, options); So did anyone experience this issue before? Please see package.json and sample code which I used
import * as React from 'react';
import { Text, View} from 'react-native';
import BackgroundService from 'react-native-background-actions';
import { useEffect } from 'react';
const veryIntensiveTask = async (taskDataArguments: any) => {
console.log('Yahhhhhhhhhhhhhh');
};
const options = {
taskName: 'Example',
taskTitle: 'ExampleTask title',
taskDesc: 'ExampleTask description',
taskIcon: {
name: 'ic_launcher',
type: 'mipmap',
},
color: '#ff00ff',
linkingURI: 'yourSchemeHere://chat/jane', // See Deep Linking for more info
parameters: {
delay: 1000,
},
};
export function IntroScreen({ navigation }: any) {
const startBackgroundTasks = async () => {
try {
if (BackgroundService) {
await BackgroundService.start(veryIntensiveTask, options); // I believe here where its failing
await BackgroundService.updateNotification({
taskDesc: 'New ExampleTask description',
});
}
} catch (error) {
console.error(error);
}
};
useEffect(() => {
console.log('Yaaag');
startBackgroundTasks();
}, []);
return (
<View>
<Text>Bavckground Service System</Text>
</View>
);
}
Any suggestions or feedback would be appreciated :)
The text was updated successfully, but these errors were encountered:
abdulwahid211
changed the title
[TypeError: Cannot read property 'start' of null]
[TypeError: Cannot read property 'start' of null] Did anyone getting this for the first time?
Oct 3, 2024
abdulwahid211
changed the title
[TypeError: Cannot read property 'start' of null] Did anyone getting this for the first time?
[TypeError: Cannot read property 'start' of null] Did anyone got this for the first time?
Oct 3, 2024
I'm using the latest
"react-native-background-actions": "^4.0.1"
, trying to understand why am I getting null when I do awaitBackgroundService.start(veryIntensiveTask, options);
So did anyone experience this issue before? Please see package.json and sample code which I usedPackage.json
sampleCode.tsx
Any suggestions or feedback would be appreciated :)
The text was updated successfully, but these errors were encountered: