transistorsoft / react-native-background-fetch

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

please need your complete guidance/support on how to implement a daily wallpaper changer in react native ( run task even when the app is closed ). #492

Open zakirtest123 opened 1 month ago

zakirtest123 commented 1 month ago

Your Environment

Expected Behavior

Actual Behavior

Steps to Reproduce

1. 2. 3. 4.

Context

please need your complete guidance/support on how to implement a daily wallpaper changer in react native ( run task even when the app is closed ).

Debug logs

christocracy commented 1 month ago

I don’t know what a “wallpaper changer” is (nor am I interested).

For Android, this plug-in implements the WorkManager API, which can execute your provided callback function about every 15 minutes.

what you do in your callback is your business. The only thing I’m interested is seeing your callback execute (eg a console.log showing up in your logs).

see the readme to learn how to simulate events.

christocracy commented 1 month ago

For terminated state, see api docs in readme enableHeadless and learn how to implement a “HeadlessTask”

zakirtest123 commented 4 weeks ago

I went through several docs... including the https://reactnative.dev/docs/headless-js-android... could not follow as it is in Java. "Wallpaper changer" : this wallpaper app will change the wallpaper of the phone daily (every 24 hours) automatically, even if the app is in foreground, background and terminated state.

On Mon, Apr 15, 2024 at 2:20 AM Chris Scott @.***> wrote:

For terminated state, see api docs in readme enableHeadless and learn how to implement a “HeadlessTask”

— Reply to this email directly, view it on GitHub https://github.com/transistorsoft/react-native-background-fetch/issues/492#issuecomment-2054180631, or unsubscribe https://github.com/notifications/unsubscribe-auth/BH2LPFTDV3DFDSV6LDNMIA3Y5LTYHAVCNFSM6AAAAABGGJ3RZCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANJUGE4DANRTGE . You are receiving this because you authored the thread.Message ID: @.*** .com>

christocracy commented 4 weeks ago

Stop concentrating on “wallpaper change” and just focus on the simple task of logging a simple message in your callback.

you don’t need to “read Java”. All the api docs are linked in the readme

mdzakir commented 15 hours ago

Ok, so you mean to say that if the stopOnTerminate: true and enableHeadless: true is set then no need of adding any Java code?

christocracy commented 13 hours ago

Why don’t you try it and see?