Quantcast
Channel: Active questions tagged react-native+ios - Stack Overflow
Viewing all articles
Browse latest Browse all 16552

How do I schedule tasks in react-native for all application states?

$
0
0

I'm developing my first mobile app ever and am learning the development and execution environment with react-native.

Simply, I want to create a task scheduler that runs every hour and only between the hours that user defines and send a very simple push notification. I want the task scheduler to be able to run when the app is open in the foreground, when the app is in the background and when the application is closed.

My solution is using this library for local push notifications: https://github.com/zo0r/react-native-push-notification

But i'm struggling to find a solution to schedule a task that pushes these notifications that works across all the three states mentioned above. I have found this library (https://github.com/jamesisaac/react-native-background-task) for scheduling background tasks but I feel like I will need a hybrid approach with either remote notifications, like with firebase, or storing in local storage and having a timer in the app itself.

Does the community have a common pattern to achieve this use case? Thanks


Viewing all articles
Browse latest Browse all 16552

Trending Articles