jamesisaac / react-native-background-task

Periodic background tasks for React Native apps, cross-platform (iOS and Android), which run even when the app is closed.
MIT License
1.11k stars 110 forks source link

Single periodic task? #55

Closed joeabill closed 6 years ago

joeabill commented 6 years ago

Sorry, this is probably a stupid question but I want to clear this up before I get too involved with this module. The readme says "This library allows the scheduling of a single periodic task" so I am a little confused if I can do multiple "tasks". For example, say I want to make 3 web services calls (with different intervals) and do something with the responses.

jamesisaac commented 6 years ago

The platform limitation on both platforms is one background task per ~15 mins. You can't bypass that and have things more frequent than that by having multiple tasks.

However, of course you could have your own logic within the task which e.g. executes 1 of 3 code paths depending on a stored value of what was executed last time.

joeabill commented 6 years ago

That's what I thought. Thank you for your response and the awesome module!