Raja0sama / rn-foreground-service

Foreground Service for React Native made with ❤
https://rn-foreground.vercel.app/
148 stars 70 forks source link

how to block initial loading only need after onwards #109

Open SKHRAPP opened 2 weeks ago

SKHRAPP commented 2 weeks ago

please help @Raja0sama

I have check in button when click button functionality of button to fetch location and send to backend same function also written inside ReactNativeForegroundService.add_task when I button click service will start and sending location when check in button clicks and also inside ReactNativeForegroundService.add_task also works I need prevent initial time when click button only after onwards I need send locations to backend

 ReactNativeForegroundService.add_task(
        async () => {
           console.log("checking.....")
        },
        {
          delay:5 * 60 * 1000,
          onLoop: true,
          taskId: 'taskid',
          onError: e => console.log(`Error logging:`, e),
        },
      );