Closed j-mendez closed 5 years ago
+1
+1
+1
+1
Have you enabled the Background Fetch feature in Xcode for the project? https://github.com/transistorsoft/react-native-background-fetch/blob/master/docs/INSTALL-MANUAL-IOS.md#configure-background-capabilities
Have done the setup and same issue on my side. Made sure the plist was correct and fully followed it
@jamesisaac yes. The only thing I can think of is that I was using a higher version for react-native-background-fetch. Is it required to use the specific version that you specified?
@jamesisaac actually you do not state a exact version nvm. Going to test this later on today to see if it works after the RN project upgrade to 0.53.0 .
I see this module uses react-native-background-fetch
for iOS, and in its README it says:
iOS can take some hours or even days to start a consistently scheduling background-fetch events since iOS schedules fetch events based upon the user's patterns of activity. If Simulate Background Fetch works, your can be sure that everything is working fine. You just need to wait.
Might be a reason?
I haven't used this module myself, I'm just looking through options. But might be worth to check with Debug->Simulate Background Fetch
I've been experimenting with background fetch in iOS in the past few weeks, my conclusion is you are not going to be able to reliably run background tasks on a regular basis. On an iPhone left idle and the app open in the background, it seems to run about twice a day with 1 hour between those. Presumably this is due to them using some kind of algo to decide when to run background fetch, as mentioned by @cbrevik.
react-native-background-fetch
appears to (as of a few weeks ago) have Android support too.
Waited about 30 mins and the task defined only had a console.log and it did not fire. Tested on a physical device.