-
Notifications
You must be signed in to change notification settings - Fork 247
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
❓How to schedule a Periodic Task #4
Comments
Hi @kterto, 👋 Thanks for checking out this package. The background job you wish to execute should be written in Dart, you do not need to do any native work to make it work. |
Hi, @timrijckaert, that's my use case: |
Alright, you would want to do something like this: Define a top level function lets call it You need to return either
You then need to initialize the plugin with this function.
Let me know if it works. |
Ok, I've been doing something like what you've just said, but where I define the action? Where am I supposed to write the body of the actual function firebaseSyncing that I want to run in the background? |
|
Now the problem is said to be that executeTask is not implemented in the Workmanager. |
You are correct, I was referencing the upcoming |
Does it work for you now? |
I had a problem in the machine and I had to restart... But it's not working yet. |
You are most likely running the app on an iOS simulator?
We are currently working on implementing iOS support in an upcoming version. Let me know if it works. |
Actually I'm running in my android Mobile, not in a simulator. I've wrapped the code in the if statement and still not working. |
Could you send me the code please |
That's what I'm trying to do: |
Yes I see we have a small bug.
|
outcome with the isInDebugMode flag: |
It worked! The native crash underneath is not caused by the plugin. |
If I run without the isInDebugMode flag, I still get an error. Is there any way of running in debug mode and not showing the system notification? |
You could set the I also just updated the plugin to version
|
(sorry to keep reopening this issue, should I use another one?) |
I just tested myself with a simple plugin It's better to open up a different issue as this is totally separate bug. |
Was there a solution to this? Are method calls not working in workmanager? |
I've been trying to use the package, but I couldn't find out where to put the code to perform the desired Task. As I understood from the working example and from the plugin implementation, I would have to write a custom class that extends the Worker and override the doWork function, but when installing the package by pubspec I wasn't able to find out where to put it.
The text was updated successfully, but these errors were encountered: