Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
zakirtest123 opened this issue Apr 14, 2024 · 7 comments

Comments

@zakirtest123
Copy link

Your Environment

  • Plugin version:
  • Platform: Android
  • OS version:
  • Device manufacturer / model:
  • React Native version (react-native -v):
  • Plugin config

Expected Behavior

Actual Behavior

Steps to Reproduce

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
Copy link
Member

christocracy commented Apr 14, 2024

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
Copy link
Member

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

@zakirtest123
Copy link
Author

zakirtest123 commented Apr 15, 2024 via email

@christocracy
Copy link
Member

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
Copy link

mdzakir commented May 14, 2024

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
Copy link
Member

Why don’t you try it and see?

@mdzakir
Copy link

mdzakir commented May 22, 2024

wow! that's awesome!!! It works. Able to simulate setting the wallpaper in all states (foreground, background and terminated) of the device. thanks a ton @christocracy 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants