How do I set up my Expo app to automatically perform tasks every 5 minutes?
P粉285587590
P粉285587590 2023-09-10 17:42:40
0
1
498

I have an app created using React Native and Expo. I need the app to send a notification to the smartphone every 5 minutes if there is a new order with nearby GPS coordinates. I'm trying to figure out how to do this. I've tried creating a BackgroundFetch task that checks my backend every 5 minutes for available orders, but in Expo Go the task doesn't run every 5 minutes but randomly. Does anyone have any ideas?

P粉285587590
P粉285587590

reply all(1)
P粉415632319

Try using setInterval => "Repeat the callback function every delay milliseconds."

setInterval(() => {
     sendNotification()
    }, 5000);

Hope it helps you.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template