transistorsoft / react-native-background-fetch

Periodic callbacks in the background for both IOS and Android
MIT License
1.43k stars 191 forks source link

Set wallpaper every 15 minutes in the background task(question) #485

Closed jasan-s closed 2 months ago

jasan-s commented 2 months ago

Your Environment

Expected Behavior

Update Android wallpaper every 15 minutes, even if user closed app.

Context

I want to change user wallpaper every 15 minutes, would this lib allow be to set wallpaper that I fetch every 15 minutes? This is def a question and not a bug report.

Debug logs

christocracy commented 2 months ago

This plug-in fires a callback periodically according to the minimumFetchInterval.

What you do in that callback is up to you.

vvusts commented 1 month ago

@jasan-s was this library actually help you to change wallpaper on time even when app is killed?

christocracy commented 1 month ago

even when app is killed?

the iOS platform does not fire background-fetch events after app terminate, only Android can.

vvusts commented 1 month ago

Hi thank you for answer :) I am asking only for android I don't need IOS for my case.

One thing that is not clear to me is that background-fetch event will trigger every around 15min in what circumstances it will not trigger?

I also need to change wallpaper on android once in a day. And I think this library is bingo but need to be sure that it will execute in away I need it. Appreciate your support :)

christocracy commented 1 month ago

what circumstances it will not trigger?

I don’t know. The plug-in uses Android’s WorkManager api. It’s totally up to the OS.

do your own testing and let the demo app run for a week. It stores received events in persistent storage.