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粉4156323192023-09-11 15:50:45
Try using setInterval => "Repeat the callback function every delay milliseconds."
setInterval(() => { sendNotification() }, 5000);
Hope it helps you.