Closed Malhar99 closed 8 months ago
Did you get a solution?
I found a solution by deleting pods
and podfile.lock
and then running pod install
Strangely enough part of the solution was to close, the terminal running your simulator and closing xcode
then reopening everything and rebuilding.
So the process I followed was
cd ios && rm -rf Pods && rm -rf podfile.lock && pod install
Close xcode, simulator and terminal and reopen and rebuild.
import BackgroundService from 'react-native-background-actions';
const sleep = time => new Promise(resolve => setTimeout(() => resolve(), time));
// You can do anything in your task such as network requests, timers and so on, // as long as it doesn't touch UI. Once your task completes (i.e. the promise is resolved), // React Native will go into "paused" mode (unless there are other tasks running, // or there is a foreground app). const veryIntensiveTask = async taskDataArguments => { // Example of an infinite loop task const {delay} = taskDataArguments; await new Promise(async resolve => { for (let i = 0; BackgroundService.isRunning(); i++) { console.log(i); await sleep(delay); } }); };
const backgroundTask = async () => { 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, }, };
};
backgroundTask();
"react-native-background-actions": "^3.0.1", "react-native": "0.72.4",
Need urgent solution